Hi All,
I am trying to use ftp:poller component of servicemix.
The requirement is very simple:
Download a file from FTP Server to the local system and send a JBI message to
another service unit.
I am expecting the message to carry information regarding where the file was
downloaded, so that I can take it up for processing in the bean.
I deploy the service assembly and the Deployment was successful. But nothing
happens after that.
I am expecting to see my System.out statement printed on the console.
I even enabled DEBUG, hoping to see some useful message. But no interesting
messages there.
I am using 2 components for this purpose. Files in the FTP Server location are
XML.
Can any of you help me in this?
1. FTP Poller <ftp:poller>:
xbean.xml :
...
<ftp:poller service="mediations:file"
endpoint="MyFTPPollerEndpoint"
targetService="mediations:fileListenerService"
uri=ftp://me:m...@myftpserver/test" />
2. Listener Bean <bean:endpoint> and <bean>:
xbean.xml:
...
<bean:endpoint service="mediations:fileListenerService"
endpoint="MyListenerEndpoint" bean="#listener"/>
<bean id="listener" class="com.test.MyFileListener"/>
MyFileListener.java
....
public class MyFileListener implements MessageExchangeListener {
@Resource
private DeliveryChannel channel;
public void onMessageExchange(MessageExchange exchange) throws
MessagingException
{
System.out.println("############################## Received exchange: " +
exchange);
exchange.setStatus(ExchangeStatus.DONE);
channel.send(exchange);
}
}
Thanks for your help in advance
Ramu