camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: No hit during Multicast
Date Tue, 12 Jun 2012 10:41:04 GMT
On Tue, Jun 12, 2012 at 12:18 PM, kenhans <kenhansa@hotmail.co.uk> wrote:

> yes, I see that my description of the filter is lacking. It's actually a
> loop
> like this, where the producers contain filter-methods:
>
> MulticastDefinition multicastDefinition = route.multicast().onPrepare(new
> DocumentDeepClone());
> for (Producer producer : producers) {
>  multicastDefinition
>   .filter().method(producer, "filter")
>  .bean(producer, "createEvent")
>  .to(EndPointUri.INCOMING_EVENT_QUEUE);
> }
>
> so my problem is that the Exchange is not forwarded to the destination
> (.bean...) if the filter Predicate of all Producers are false. And I do not
> know how to handle that case. I do not seem to have any handle to the
> Exchange after all predicates are false. How would the AggregationStrategy
> help me here? I just want to discover the special case when all filter
> predicates of the producers are false
>
>
You can set a special header in the .bean, and detect if that header is
absent in your aggregation strategy.
Then you know all the filters was false.

Another way is that Camel sets the
http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/Exchange.html#TO_ENDPOINT
header when you send a message to a destination using .to and some of the
other EIPs.
So if that header has not changed then all your filters is also false.




>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/No-hit-during-Multicast-tp5683138p5714340.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message