Hello,

a common requirement with JMS is to consume messages concurrently in
multiple threads in order to make an application more responsive.

I agree but I have a question about aggregation strategy with the
architecture below :


in my spring context :
...
<bean id="jmsConfig"
class="org.apache.camel.component.jms.JmsConfiguration">
                <property name="connectionFactory" 
ref="pooledConnectionFactory" />
                <property name="transacted" value="false" />
                <property name="concurrentConsumers" value="1" />
</bean>
...

in my RouteBuilder :

AggregationStrategy as = new FileAggregationStrategy();

from("file:/data/depot").split(body(String.class).tokenize("\n")).streaming().to("activemq:ready");

from("activemq:ready").aggregate(property("gedFileName"),
as).completionPredicate(
                                                new 
MyCompletionPredicate()).beanRef("sendReturnFile");


I have implemented my own aggregation strategy which is based on a
"SplitComplete" predicate because I have used a splitter with streaming
mode.
The problem is that with concurrent JMS consumers on the "activemq:ready"
queue, the last message (with the property  SplitComplete=true) can be
processed before the real last message.

Is there a (elegant) solution to create an aggregation strategy which works
in this use case ?

Thanks for your suggestions...
JM
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/aggregation-strategy-JMS-concurrentConsumers-splitter-in-streaming-mode-tp3293712p3293712.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to