Hi,
perhaps you want to take a look at ActiveMQ Message Groups. I think this
could solve your problem (if you're using ActiveMQ).
http://activemq.apache.org/message-groups.html
Best regards - Claus
On 06.12.2010 09:40, jmh wrote:
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