camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
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 <> 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")
> }
> 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
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:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Twitter: davsclaus, fusenews
Author of Camel in Action:

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