3 Replies Latest reply on Nov 12, 2009 3:26 PM by lyfe

    scatter-gather pattern with web services only

    lyfe

      I'm a newbie trying to implement the scatter-gather patten using web services only.  I say "web services only" because all the examples I've seen implementing this pattern involved a message queue so not sure this can even be done.

       

      My problem I'm hitting is when I output what's suppose to be gathered.  In a multicast tag, I have two web services being called via jbi endpoints (they are set up as http providers).  I then send the results to my aggregation strategy code.  Finally, I print to the logs what was gathered.  However, instead of outputting a result containing two messages, it only outputs one message.  After a bit of testing, I noticed it only outputs the message from the last service called (based on my server log and order in camel-context.xml file).

       

      I modified the bridge-camel example that came with servicemix as follow:

      1) in the client and bridge-jms-su code, I did nothing since I don't need it.

      2) in the bridge-http-su code, I added two http providers that take soap messages.

      3) in the bridge-camel-su, I added the source code for my aggregation strategy and I modified the camel-context.xml (to remove references to the jms endpoint and add my own logic).

       

      new camel-context.xml (unnecessary content hidden for simplicity, hopefully)

      ==========================================================

       

       

       

      ======================================

       

      My aggregation stategy follows Torten's (http://tmielke.blogspot.com/2009/01/using-camel-aggregator-correctly.html) since I just want to combine the messages.

       

      I've tried adding the strategy reference to the multicast tag (with no aggregrate tag) and the aggregate tag, individually, with no desired results.

       

      Edited by: lyfe on Nov 7, 2009 8:35 AM (added correct tag for method call, elaborated on modications done to camel-context.xml and added params to multicast tag)