You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by SteveR <sr...@vonage.com> on 2015/10/22 20:15:39 UTC

Camel 2.15.3: multicast with aggregationStrategy() not working ...

I'm using Camel 2.15.3 with a route that reads from *netty4:udp* and
multicasts to two SEDA queues and uses *aggregationStrategy()* to choose the
correct response to send back to the client as the UDP reply.

I can see the correct reply coming into the aggregate() method, but setting
the *Exchange.AGGREGATION_COMPLETE_CURRENT_GROUP* property on the returned
exchange does not stop the aggregation.  Am I doing something wrong, or do
we know of any bugs in the area?


Thanks, SteveR

    @Override
    public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
	
        String newBody = newExchange.getIn().getBody(String.class);
        if(newBody.contains(CQMS_ACK_SUBSTRING)) {
           
newExchange.getOut().setBody(newExchange.getIn().getBody(String.class));
           
newExchange.getOut().setHeaders(newExchange.getIn().getHeaders());
           
newExchange.setProperty(Exchange.AGGREGATION_COMPLETE_CURRENT_GROUP, true);
            return newExchange;
        }
        return newExchange;
    }


	from(fromURI)
		.setExchangePattern(ExchangePattern.InOut)
		.routeId(sourceRouteId)
		.setProperty(Exchange.CHARSET_NAME,
ExpressionBuilder.constantExpression(charsetName))
		.threads(threadPoolSize /*poolSize*/, threadPoolSize * 2 /*maxPoolSize*/)
			.threadName("threads_" + sourceRouteId)
		.callerRunsWhenRejected(true); // Hard-coded since we always want this
behavior!
			.multicast()
			.parallelProcessing()
			.aggregationStrategy(new CqmsAckBackAggregationStrategy(ackBackRequired,
charsetName))
			.to(firstToURIs);  



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-15-3-multicast-with-aggregationStrategy-not-working-tp5772978.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel 2.15.3: multicast with aggregationStrategy() not working ...

Posted by Claus Ibsen <cl...@gmail.com>.
Exchange.AGGREGATION_COMPLETE_CURRENT_GROUP is for the aggreagator
eip, not muilticast.

On Thu, Oct 22, 2015 at 8:15 PM, SteveR <sr...@vonage.com> wrote:
> I'm using Camel 2.15.3 with a route that reads from *netty4:udp* and
> multicasts to two SEDA queues and uses *aggregationStrategy()* to choose the
> correct response to send back to the client as the UDP reply.
>
> I can see the correct reply coming into the aggregate() method, but setting
> the *Exchange.AGGREGATION_COMPLETE_CURRENT_GROUP* property on the returned
> exchange does not stop the aggregation.  Am I doing something wrong, or do
> we know of any bugs in the area?
>
>
> Thanks, SteveR
>
>     @Override
>     public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
>
>         String newBody = newExchange.getIn().getBody(String.class);
>         if(newBody.contains(CQMS_ACK_SUBSTRING)) {
>
> newExchange.getOut().setBody(newExchange.getIn().getBody(String.class));
>
> newExchange.getOut().setHeaders(newExchange.getIn().getHeaders());
>
> newExchange.setProperty(Exchange.AGGREGATION_COMPLETE_CURRENT_GROUP, true);
>             return newExchange;
>         }
>         return newExchange;
>     }
>
>
>         from(fromURI)
>                 .setExchangePattern(ExchangePattern.InOut)
>                 .routeId(sourceRouteId)
>                 .setProperty(Exchange.CHARSET_NAME,
> ExpressionBuilder.constantExpression(charsetName))
>                 .threads(threadPoolSize /*poolSize*/, threadPoolSize * 2 /*maxPoolSize*/)
>                         .threadName("threads_" + sourceRouteId)
>                 .callerRunsWhenRejected(true); // Hard-coded since we always want this
> behavior!
>                         .multicast()
>                         .parallelProcessing()
>                         .aggregationStrategy(new CqmsAckBackAggregationStrategy(ackBackRequired,
> charsetName))
>                         .to(firstToURIs);
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-2-15-3-multicast-with-aggregationStrategy-not-working-tp5772978.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2nd edition:
https://www.manning.com/books/camel-in-action-second-edition