PDA

View Full Version : FTP Handler



vijaynairis
May 15th, 2008, 04:03 AM
Hi,

Just to summarize my understanding a bit, I configured an FTPSource adapter to retrieve files from our FTP server i.e. I configured a adapter and a channel to listen to that adapter....which worked fine no issues...

I also wrote a message endpoint (MessageHandler if my understanding is correct) which listens on that channel like this just to see if it gets invoked by the message bus but it doesnt...so was wondering how would this thing work ? Any help would be appreciated..Thanks in advance

This is my message endpoint



@MessageEndpoint(input="ftpChannel")
public class FCPBFTPEndPoint {
private static final Logger LOGGER =
Logger.getLogger(FCPBFTPEndPoint.class);

@Handler
public void handleFtp(Message message){
LOGGER.debug("getting into this");
LOGGER.debug("This message is" +message);
}
}

This is my xml configuration


<message-bus/>
<channel id="ftpChannel"/>
<annotation-driven />

Mark Fisher
May 15th, 2008, 07:15 AM
It looks like you are very close.

You just need to be sure that a bean definition is created for your endpoint. There are two ways you can do this: 1) use a <bean /> element or 2) define a <component-scan/> element that refers to a base-package containing that class (see the "cafeDemo.xml" in spring-integration-samples for an example of the latter).

Hope that helps.
-Mark