1

Can anyone validate this approach? I'm very new to ESBs so struggling with the best approach to what to me seems a very complex flow. I am using WSO2 ESB (Apache Synapse).

Use case:

  1. Read in cvs file with simple two columns.
  2. For each line take one of the values and pass to a lookup service (ldap) to retrieve more data
  3. take one of the values (for each line) from retrieved data and lookup to another webservice
  4. combine all lines into one message then submit resulting message to external web service

Thoughts so far are to for 1) use vfs and smooks to parse csv. This appears to be straightforward and I have got to the point where I can create a separate xml message within an iterate mediator to deal with each line. Then for 2) pass each line to custom mediator to do the ldap lookup. For 3) take that result and use one of the elements to pass to a callout mediator which gets a value back (basically doing a enum lookup) then 4) don't know haven't got that far.

So far the solution to 3 looks very complicated. The Callout mediator is expecting a message that is the full webservice message which is totally different from what the line xml looks like. I could use xslt to transform it to the correct input to webservice, but the result is the full ws response - I can get the value I'm interested in using property mediator but don't know how to insert it back into the message.

All in all, this seems like not very suited to an esb but intuitively seems the way I should be doing it. I could of course just write this all in Java but a lot of the bits appear to be there in esb.

So, any advice? Really happy to continue working through the detail but not if it is the wrong one.

thanks Conrad

Community
  • 1
  • 1
radder5
  • 236
  • 3
  • 14

1 Answers1

1

For 3) You can use payloadfactory mediator to create a custom payload to send. I think same mediator will be useful for creating the response back again.

Shelan Perera
  • 1,753
  • 1
  • 11
  • 10
  • Thanks, I'll have a good look at this. It still isn't apparent how to take the results back from payload factory and insert back into the main message. You can see I'm new to this! I can see that I can format the return from the payload factory in the out sequence but not how to integrate the one value I really want into the starting message. – radder5 Dec 20 '12 at 05:57