Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--gateway-->
- <int:gateway id="fileOutGateway" default-reply-channel="defaultReplyChannel"
- service-interface="com.uscs.test.integration.FileOutGateway"
- error-channel="defaultErrorChannel">
- <int:method name="process" request-channel="headerEnricherChannel" />
- </int:gateway>
- <!--header enricher-->
- <int:header-enricher id="successStatusHeaderEnricher" input-channel="headerEnricherChannel" output-channel="pojoInputChannel">
- <int:header name="orderId" expression="payload.orderId" />
- <int:header name="status" expression="'DONE'" />
- </int:header-enricher>
- <!--to write into ftp-->
- <int:chain id="xmlOutChain" input-channel="pojoInputChannel" output-channel="updateStatusChannel">
- <int:transformer expression="@pojoToXMLTransformer.transform(#root,payload)"></int:transformer>
- <int-ftp:outbound-gateway id="ftpOutBoundGateway" session-factory="ftpClientFactory" requires-reply="true"
- remote-directory="$lawson{ftpRootOutDir}"
- remote-filename-generator-expression="new java.text.SimpleDateFormat('yyyyMMdd_hhmmss_SSS').format(new java.util.Date()) + '_OUT'+ '.xml'"
- command="mput" >
- </int-ftp:outbound-gateway>
- </int:chain>
- <!--Error handling-->
- <int:chain id="errorStatusChange" input-channel="defaultErrorChannel" output-channel="updateStatusChannel">
- <int:header-enricher >
- <int:header name="orderId" expression="payload.failedMessage.headers.orderId" />
- <int:header name="status" expression="'ERR'" />
- </int:header-enricher>
- </int:chain>
- <!--to update status-->
- <int:chain input-channel="updateStatusChannel" output-channel="defaultReplyChannel" >
- <int-jdbc:outbound-gateway data-source="testDataSource" request-sql-parameter-source-factory="requestSource" >
- <int-jdbc:update>UPDATE EWMEDIDBF.ORDER_TEST SET STATUS=:status,
- UPDATE_DATE=CURRENT TIMESTAMP WHERE ORDER_ID=:orderId AND STATUS='INP'</int-jdbc:update>
- </int-jdbc:outbound-gateway>
- <int:service-activator expression="@orderService.updateStatus(payload,#root)" />
- </int:chain>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement