How did you feed the message to activemq? Have you been always sending the Event1 to the queue?
-- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thursday, July 25, 2013 at 6:52 AM, Usha13 wrote: > Hello, > > I am using an InOut queue and configured the following route on that queue: > from("activemq:queue:numbers").unmarshal(mapFormat) > .choice() > .when(simple("${in.body['EventType']} == 'Event1'")) > > .convertBodyTo(String.class) > .setHeader(Exchange.HTTP_METHOD, constant("GET")) > .enrich("http://service1", aggrStrategy) > .when(simple("${in.body['EventType']} == 'Event2'")) > .beanRef("multiplier", "multiply") > > .otherwise() > .beanRef("multiplier", "multiply") > ; > > I have implemented content enricher pattern here and the aggrStrategy will > retrieve a parameter from the response of service1, add it to the original > request and send that new response. > > The first time I run this code it works fine and gives me the new response. > Then next time I run it, the response I get is the response directly from > service1. The aggregation strategy code is not applied and it just returns > the complete response from service1. I get this response for any event type > (EventType1, EventType2 etc). > This happens in an alternate fashion. Meaning every second run I get the > wrong response. > > I am using activemq component and activemq is running on my local machine. > > Am I missing some configuration or some piece of code here? > > Thank you > Usha > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Different-response-messages-tp5736239.html > Sent from the Camel - Users mailing list archive at Nabble.com > (http://Nabble.com).