Advertisement
Guest User

Untitled

a guest
May 23rd, 2016
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. @Override
  2. public void configure() throws Exception {
  3.  
  4. from("imaps://outlook.office365.com?username=almhu390@student.otago.ac.nz"
  5. + "&password=hussain1412"
  6. + "&searchTerm.subject=Vend:SaleUpdate"
  7. + "&debugMode=false" // set to true if you want to see the authentication details
  8. + "&folderName=INBOX") // change to whatever folder your Vend messages end up in
  9. .convertBodyTo(String.class)
  10. .log("${body}")
  11. .unmarshal().json(JsonLibrary.Gson, Sale.class)
  12. .to("jms:queue:vend-new-sale");
  13.  
  14. from("jms:queue:vend-new-sale").log("${body}")
  15. .to("rmi://localhost:1099/sales?remoteInterfaces=aggregation.ISaleAggregation&method=newSale");
  16.  
  17. from("imaps://outlook.office365.com?username=almhu390@student.otago.ac.nz"
  18. + "&password=hussain1412"
  19. + "&searchTerm.subject=Vend:InventoryUpdate"
  20. + "&debugMode=false" // set to true if you want to see the authentication details
  21. + "&folderName=INBOX") // change to whatever folder your Vend messages end up in
  22. .convertBodyTo(String.class)
  23. .log("${body}")
  24. .removeHeaders("*")
  25. .setHeader(Exchange.HTTP_METHOD, constant("POST"))
  26. .setHeader(Exchange.CONTENT_TYPE, constant("text/xml"))
  27. .unmarshal().json(JsonLibrary.Gson, Order.class).log("LOG HERE ******** : ${body}")
  28. .to("http4://localhost:8083/orders")
  29. .to("jms:queue:http-response");
  30. }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement