Advertisement
Guest User

Untitled

a guest
Feb 8th, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. <!--gateway-->
  2. <int:gateway id="fileOutGateway" default-reply-channel="defaultReplyChannel"
  3. service-interface="com.uscs.test.integration.FileOutGateway"
  4. error-channel="defaultErrorChannel">
  5. <int:method name="process" request-channel="headerEnricherChannel" />
  6. </int:gateway>
  7. <!--header enricher-->
  8. <int:header-enricher id="successStatusHeaderEnricher" input-channel="headerEnricherChannel" output-channel="pojoInputChannel">
  9. <int:header name="orderId" expression="payload.orderId" />
  10. <int:header name="status" expression="'DONE'" />
  11. </int:header-enricher>
  12.  
  13. <!--to write into ftp-->
  14.  
  15. <int:chain id="xmlOutChain" input-channel="pojoInputChannel" output-channel="updateStatusChannel">
  16.  
  17. <int:transformer expression="@pojoToXMLTransformer.transform(#root,payload)"></int:transformer>
  18. <int-ftp:outbound-gateway id="ftpOutBoundGateway" session-factory="ftpClientFactory" requires-reply="true"
  19. remote-directory="$lawson{ftpRootOutDir}"
  20. remote-filename-generator-expression="new java.text.SimpleDateFormat('yyyyMMdd_hhmmss_SSS').format(new java.util.Date()) + '_OUT'+ '.xml'"
  21. command="mput" >
  22. </int-ftp:outbound-gateway>
  23. </int:chain>
  24.  
  25. <!--Error handling-->
  26.  
  27. <int:chain id="errorStatusChange" input-channel="defaultErrorChannel" output-channel="updateStatusChannel">
  28. <int:header-enricher >
  29. <int:header name="orderId" expression="payload.failedMessage.headers.orderId" />
  30. <int:header name="status" expression="'ERR'" />
  31. </int:header-enricher>
  32. </int:chain>
  33.  
  34. <!--to update status-->
  35. <int:chain input-channel="updateStatusChannel" output-channel="defaultReplyChannel" >
  36. <int-jdbc:outbound-gateway data-source="testDataSource" request-sql-parameter-source-factory="requestSource" >
  37. <int-jdbc:update>UPDATE EWMEDIDBF.ORDER_TEST SET STATUS=:status,
  38. UPDATE_DATE=CURRENT TIMESTAMP WHERE ORDER_ID=:orderId AND STATUS='INP'</int-jdbc:update>
  39. </int-jdbc:outbound-gateway>
  40. <int:service-activator expression="@orderService.updateStatus(payload,#root)" />
  41. </int:chain>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement