Thanks for your support gnodet.
Now i am able to get the aggregated message after putting this code in each
component
if (exchange.getStatus() == ExchangeStatus.DONE) {
return;
}
After sending the inonly message to the aggregator i have set the status to
DONE.
exchange.setStatus(ExchangeStatus.DONE);
But for the first request i am not getting any aggregated message in the
queue but in the trace component i am able to view the aggregated message
and for the remaining requests i am getting the messages in the queue
without any exceptions.
Can you tell me the reason for this.
gnodet wrote:
>
> The main reasons for your problems is that your lightweight components
> do not correctly
> handle the exchanges.
> First, i would encourage you to use servicemix-bean instead, because
> servicemix-lwcontainer
> is deprecated.
> Second, when dealing with InOnly exchanges, the exchange will come
> back to the endpoint
> with a DONE status, so you need to ignore them. Else, as you can see
> in your log, you end up with
> more and more messages in the bus, because each component will send
> two messages instead of
> one. Also don't forget to set the DONE status and send back the
> exchange when your component
> acts as a provider.
>
> The code of your components should look like:
>
> public void processExchange(MessageExchange exchange) {
> if (exchange.getStatus() == ExchagneStatus.DONE) {
> // Ignore the exchanges that come back in a done status
> // these are the ones we created and sent
> return;
> }
> // we receive an exchange, so create a new exchange, populate it
> // and send it, then set the DONE status on
> InOnly newExchange = ...
> channel.send(newExchange);
> exchange.setStatus(ExchangeStatus.DONE);
> channel.send(exchange);
> }
>
> On Wed, Feb 27, 2008 at 5:16 PM, sachin2008 <[EMAIL PROTECTED]> wrote:
>>
>> I am attaching the log.Can u please look into it
>>
>> http://www.nabble.com/file/p15716668/servicemix.log servicemix.log
>>
>>
>>
>> gnodet wrote:
>> >
>> > It should be set automatically.
>> > Could you paste the log at debug level ?
>> >
>> > On Wed, Feb 27, 2008 at 4:57 PM, sachin2008 <[EMAIL PROTECTED]>
>> wrote:
>> >>
>> >> Can you please tell me how to set the global
>> >> variable"org.apache.servicemix.correlationId".
>> >>
>> >>
>> >>
>> >> gnodet wrote:
>> >> >
>> >> > If you add the following lines in your components, you should see
>> >> them, as
>> >> > the
>> >> > exception happens when aggregating those messages later.
>> >> >
>> >> > for (Object key : exchange.getPropertyNames()) {
>> >> > System.out.println(key + ": " + exchange.getProperty((String)
>> >> key));
>> >> > }
>> >> >
>> >> > If the "org.apache.servicemix.correlationId" is not listed, there
>> is a
>> >> > problem ...
>> >> >
>> >> > On Wed, Feb 27, 2008 at 3:58 PM, sachin2008 <[EMAIL PROTECTED]>
>> >> wrote:
>> >> >>
>> >> >> I am not able to trace that one
>> >> >>
>> >> >> I am getting the same exception continuously. Whether there is
>> any
>> >> way
>> >> >> to
>> >> >> set that global variable anywhere else.
>> >> >>
>> >> >>
>> >> >>
>> >> > --
>> >> > Cheers,
>> >> > Guillaume Nodet
>> >> > ------------------------
>> >> > Blog: http://gnodet.blogspot.com/
>> >> >
>> >> >
>> >>
>> >> --
>> >>
>> >>
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Reg%3AAggregator-Pattern-tp15582806s12049p15716224.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/Reg%3AAggregator-Pattern-tp15582806s12049p15716668.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/Reg%3AAggregator-Pattern-tp15582806s12049p15717550.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.