Hi
You can use the tracer to enable tracing of the exchanges how they are routed
in Camel.
http://activemq.apache.org/camel/tracer.html
And I suppose that you type wrong in this mail as you wrote from:a twice:
from("direct:a").process(new myProcessor()).bean(beanB,
"methodB").to("direct:merge");
That is should be: from("direct:b")
Med venlig hilsen
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: RobMMS [mailto:[EMAIL PROTECTED]
Sent: 27. oktober 2008 13:15
To: [email protected]
Subject: ExchangePatterns on Bean-Component
Hi,
I'm observing a somewhat strange behaviour in my route:
from("direct:start").multicast(new MyOutAggregationStrategy(),
true).to("direct:a", "direct:b");
from("direct:a").process(new myProcessor()).bean(beanA,
"methodA").to("direct:merge");
from("direct:a").process(new myProcessor()).bean(beanB,
"methodB").to("direct:merge");
from("direct:merge").
aggregator(header(QueryPreProcessor.HEADER_CORRELATION_ID), new
ResultAggregationStrategy()).
completedPredicate(header("aggregated").
isEqualTo(header("parallelStagesCount"))).
to("mock:end");
List result =(List) template.sendBody("direct:start", ExchangePattern.InOut,
myQueryString);
What I want to do here is, I send a query-String to direct:a, which then
multicasts to my parallel working beans, that each take a String value as
paramter in methodA/B and return a ResultObjectA/B which is set as Body
automatically (I do not set this explicitly in the beans).
My ResultAggregationStrategy then puts ResultObjectA and ResultObjectB into
als List-List which I want to get back as result of the template.sendbody
call.
The problem is that my result is most of the time the return value of the
first bean being processed, only sometimes (like 10% of the time) it returns
the aggregated list as expected.
I would expect the my route processes each step an when the aggregated
message reaches mock:end the message's out body is returned to the caller ->
result
I'm not quite sure when I have to set the message's Out-Body and when it's
ok to set the In-Body, because I think thats the problem here, but I'm not
sure.
Maybe I'm completely wrong, so I hope you get what I need and tell me whats
wrong with my route ;)
Thanks,
Rob
--
View this message in context:
http://www.nabble.com/ExchangePatterns-on-Bean-Component-tp20186540s22882p20186540.html
Sent from the Camel - Users mailing list archive at Nabble.com.