1 Reply Latest reply on Oct 8, 2007 4:41 AM by kconner

    Should I use Aggregation at all?

    haagenhasle

      Hi!

      I have previously posted a question regarding my use of StaticRouter and Aggregator. I have a new question now, cause I've begun to wonder if I should use Aggregator at all. The use-case is as I described it earlier, I split my request so that it can be sent to two different services, and then I examine the response from these two services and merge them into one.

      I've rewritten my code lately from using the Body.DEFAULT_LOCATION in Body for storing my objects, to using different locations that I name myself. I'm thinking that I could use these locations to achieve the same functionality that the StaticRouter/Aggregator gives me in a single Service without splitting the process-flow.

      I can have several actions in a chain, where one makes a call to the first target-service and stores it using Body.add("service1", obj), another makes a call to the second target-service and stores it using Body.add("service2", obj2), and a third retrieves the two objects and merge them into one.

      I hope somone experienced in JBossESB can help me figure out which approach to use. What are the advantages to using StaticRouter/Aggregator? What is the best practice when it comes to using different locations when adding to the Body?

        • 1. Re: Should I use Aggregation at all?
          kconner

          It is really up to you how to structure the application but I would certainly recommend using the aggregator given your scenario.

          The advantage of using the aggregator is that you can split your processing into concurrent, asynchronous service requests which should have a much better performance/reliability than chaining synchronous calls through the actions.

          As for the different locations, this is part of the contract you would define when specifying your action/service and are free to use them as would fit your purpose.