Hi Gunnar,
Thanks for the reply.
I have set up the ftp channel adapter.
I also set up the error channel but it does not see to work for me..
Here is the code snippet
This is the sftp Channel adapter.
Code:
<sftp:outbound-channel-adapter channel="sendChannel"
session-factory="sftpSessionFactory" id="sftpInboundAdapter1"
auto-create-directory="true" temporary-file-suffix="temp"
remote-directory-expression="headers['remote-directory']" />
xml configuration for handling error
Code:
<bean id="errorException"
class="org.springframework.integration.router.Erro rMessageExceptionTypeRouter">
<property name="channelMappings">
<util:map>
<entry key="java.lang.Exception" value="retrySftpChannel1" />
</util:map>
</property>
<property name="defaultOutputChannel" ref="processChannel1" />
</bean>
<int:channel id="processChannel1" />
<int:channel id="retrySftpCahnnel1" />
<int:service-activator input-channel="processChannel1"
ref="pmExporter" method="messageException" />
<!-- using a transformer to get the failed message -->
<int:transformer input-channel="retrySftpChannel1"
output-channel="retryChannel1"
expression="T(org.springframework.integration.supp ort.MessageBuilder).
withPayload(payload.getFailedMessage().getPayload( )).build()" />
<!-- the file will be written to a failed directory -->
<int:service-activator input-channel="retryChannel1"
ref="pmExporter" method="retryMessage">
</int:service-activator>
I'm assuming the above code is the error channel.Please let me know if it is not,
These above exceptions do not work for me so,I have the try ,catch blocks and within the java program and there I handle
these below exception once the message is sent in the sftp channel and within the catch blocks of the exceptions I individually handle the messages in case of failure for any resaon.
Code:
catch(MessageHandlingException ex)
catch(com.jcraft.jsch.JSchException ex)
catch(java.net.SocketException ex)
Please let me know if this makes sense otherwise I will put in more code
Thanks