Spring Integration(JDBC - SFTP) : Read a record, send it to SFTP and delete that record -
Spring Integration(JDBC - SFTP) : Read a record, send it to SFTP and delete that record -
i have next requirement implement each incoming message our system
convert incoming to xml file , save in database read file info base of operations , send sftp delete entry 1 time file send sucessful.i have implemented step-1 :
<int-jdbc:outbound-channel-adapter query="insert table_name(id, payload) values (:headers[filename], :payload)" channel="outputchannel" jdbc-operations="jdbctemplate"> <int:poller fixed-rate="1000" /> </int-jdbc:outbound-channel-adapter>
while implementing step-2, if read entries together, payload in list spring-sftp doesn't back upwards it. if read each record , send sftp, performance problem. suggestion please?
<int-jdbc:inbound-channel-adapter row-mapper="rowmapper" query="select * table_name" channel="sftpchannel" jdbc-operations="jdbctemplate"> <int:poller fixed-rate="1000" /> </int-jdbc:inbound-channel-adapter>
how delete record upon file send successful?. guess payload.delete() won't work here.
<sftp:outbound-channel-adapter auto-startup="true" id="sftpoutboundadapter" session-factory="sftpsessionfactory" channel="sftpchannel" charset="utf-8" remote-directory="${spectrum.ftp.path}" remote-filename-generator-expression="headers[filename] + '.xml'"> <sftp:request-handler-advice-chain> <bean class="org.springframework.integration.handler.advice.expressionevaluatingrequesthandleradvice"> <property name="onsuccessexpression" value="payload.delete()" /> </bean> </sftp:request-handler-advice-chain> </sftp:outbound-channel-adapter>
spring-integration
Comments
Post a Comment