See 
http://servicemix.apache.org/servicemix-eip.html#servicemix-eip-SplitAggregator
It relies on a few properties that have to be set on the exchange so
that it can aggregate everything.
You can also change the expression used if needed, but as you control
the splitter, I would first try
to use the default ones which are "count" and "index".
See 
http://svn.apache.org/viewvc/servicemix/smx3/trunk/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/patterns/SplitAggregator.java?revision=602826&view=markup

On Wed, Feb 20, 2008 at 3:02 PM, sachin2008 <[EMAIL PROTECTED]> wrote:
>
>  Can you provide the configuration details about aggregator for aggregating
>  two or many exchanges.
>
>
>
>  gnodet wrote:
>  >
>  > Sure there is a way to do that.  You can check the role of the exchange.
>  >    if (exchange.getRole() == Role.CONSUMER)
>  >
>  > if the role is CONSUMER, then it means the exchange has been sent by
>  > *this*
>  > component.  If the role is PROVIDER, the exchange has been sent by another
>  > component to this component.
>  >
>  > Btw, even if using an asynchronous call, you could still use an InOut
>  > pattern,
>  > which may be simpler in your case, instead of using two InOnlys.
>  >
>  > The other solution, as you suspected, it to use a split / aggregator
>  > pattern (which is
>  > what you do anyway).  The drawback is that you will have to find a way
>  > to correlate
>  > the output of the aggregator to send back the request in the Out message
>  > to the
>  > HTTP BC (see http://open.iona.com/issues/browse/ESB-18).
>  >
>  > I think the best way to go is to continue using your master endpoint,
>  > but possibly
>  > switch to using InOut instead of two InOnlys, and do the aggregation of
>  > the
>  > messages inside the master endpoint.
>  >
>  > On Wed, Feb 6, 2008 at 1:26 PM, sachin2008 <[EMAIL PROTECTED]> wrote:
>  >>
>  >>  Hi, Thanks for your suggestion.
>  >>  We have created seperate exchanges and send asynchronous request.
>  >>  But we have  a small problem here. As we are sendig the requests
>  >>  asynchronously, component do not wait for the resposne. So , to get the
>  >>  responses we have used the following approach.
>  >>
>  >>  Http BC sends InOut message to the  Master component. Master  sends 4
>  >>  requestes through different Inonly exchanges to various worker beans.
>  >> Then
>  >>  worker beans sends the response back to the master component as another
>  >>  InOnly exchange but with the same corelation id.
>  >>  In this scenario, we could not be able to find  whether the message that
>  >> we
>  >>  are getting at the master component is from actual BC or from the worker
>  >>  component.
>  >>
>  >>  Is there any one to find which service has send the message to the
>  >> master
>  >>  component.
>  >>
>  >>
>  >>
>  >>
>  >>
>  >>
>  >>  gnodet wrote:
>  >>  >
>  >>  > You don't need to create your own threads for that (though you could).
>  >>  > From your component or endpoint (you could simply use servicemix-bean
>  >> for
>  >>  > that),
>  >>  > just create the four JBI exchanges and send them asynchronously.   On
>  >> each
>  >>  > exchange, set a correlation id (you can use the id of the exchange
>  >>  > received).
>  >>  > When you have received all the exchange you need, just aggregate those
>  >> and
>  >>  > set the out message from the original exchange.
>  >>  > Note that camel or servicemix-eip may help there: they both can do
>  >>  > aggregation,
>  >>  > but given that you'll have to split the exchanges yourself, it may be
>  >>  > easier to just
>  >>  > write an endpoint and do the whole.
>  >>  >
>  >>  > On Jan 31, 2008 1:31 PM, sachin2008 <[EMAIL PROTECTED]> wrote:
>  >>  >>
>  >>  >> Hi
>  >>  >> I have to develop a  component in servicemix  for the following
>  >> scenario.
>  >>  >> Can any one let me know how to do this
>  >>  >>
>  >>  >> I have one JBI  component . This JBI component receives requests from
>  >>  >> other
>  >>  >> components. On receipt of the request, this components has to do the
>  >>  >> following things.
>  >>  >>
>  >>  >> It has to send 4 request s to 4 different JBI components for some XML
>  >>  >> data.
>  >>  >> Once it receives the response for all the requests it has to merge
>  >> the
>  >>  >> response into a single NM and then send it back to requested
>  >> component.
>  >>  >>
>  >>  >> Here the problem is all the 4 requests to other components should be
>  >>  >> handled
>  >>  >> in a concurrent manner.
>  >>  >> JBI component has to send a request first to another external service
>  >> .
>  >>  >> Instead of waiting for the response for this request this component
>  >> has
>  >>  >> to
>  >>  >> send 2nd request to another external service and then to 3rd one and
>  >> then
>  >>  >> to
>  >>  >> 4th one.
>  >>  >>
>  >>  >> Finally this component needs to wait for the responses from all the
>  >>  >> external
>  >>  >> services and then continue the remaining process as I said earlier.
>  >>  >>
>  >>  >> Note – The flow between the JBI component and external services
>  >> component
>  >>  >> should be IN-OUT.
>  >>  >>
>  >>  >> Currently we are handling the same scenario by handling threads in
>  >>  >> servlets.
>  >>  >> Now we need to simulate the same using  servicemix 3.1 + jboss. But I
>  >>  >> heard
>  >>  >> that in servicemix 3.1 we can't create external threads. I guess
>  >> beanflow
>  >>  >> component solves this problem.  But I couldn't find enough info on
>  >> this .
>  >>  >> can anyone please tell me where I can found info regarding this.
>  >>  >>
>  >>  >> --
>  >>  >> View this message in context:
>  >>  >>
>  >> 
> http://www.nabble.com/concurrent-execution-in-servicemix-tp15203567s12049p15203567.html
>  >>  >> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>  >>  >>
>  >>  >>
>  >>  >
>  >>  >
>  >>  >
>  >>  > --
>  >>  > Cheers,
>  >>  > Guillaume Nodet
>  >>  > ------------------------
>  >>  > Blog: http://gnodet.blogspot.com/
>  >>  >
>  >>  >
>  >>
>  >>  --
>  >>  View this message in context:
>  >> 
> http://www.nabble.com/concurrent-execution-in-servicemix-tp15203567s12049p15306516.html
>  >>
>  >>
>  >> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>  >>
>  >>
>  >
>  >
>  >
>  > --
>  > Cheers,
>  > Guillaume Nodet
>  > ------------------------
>  > Blog: http://gnodet.blogspot.com/
>  >
>  >
>
>  --
>  View this message in context: 
> http://www.nabble.com/concurrent-execution-in-servicemix-tp15203567s12049p15589649.html
>
>
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/

Reply via email to