Is it possible to use aggregate and split with ActiveMQ/JMS?  What I'm
interested in doing is a very simple aggregation, the goal being to reduce
the sheer # of JMS messages that ActiveMQ has to deal with.  "Bundling" N
messages together is likely to speed up the throughput in my particular
case.  My message bodies are byte[] arrays (currently using BytesMessage),
and they're relatively small (500-2000 bytes).  My theory is that I can get
better JMS throughput if I "bundle" some number of payloads together in an
aggregated JMS message.

So, assuming that this isn't a horrible idea, the approach would be
something like this...

Aggregate up to N messages at a time, forcing completion every so often if
there are any incomplete aggregates, and there's no correlation at all. 
Just group up to N messages together, to be split again on the consumer
side.

Producer side:

<from uri="..."/>
<aggregate strategyRef="???" completionSize="3" completionInterval="5000">
  <correlationExpression><constant>true</constant></correlationExpression>
  <to uri="activemq:queue:myAggregatedQueue"/>
</aggregate>

Consumer side:

<from uri="activemq:queue:myAggregatedQueue"/>
<split>
  ???
  <bean ref="myPojoConsumer" method="onWhatever"/>
</split>

I've got the producer side working...sorta.  The completionSize and
completionInterval part of it works great.  But...I tried using
GroupedExchangeAggregationStrategy, and I see that it builds a
List<Exchange>, but that doesn't seem to work with JMS.  The message body
ends up being null...which I guess makes sense given what
GroupedExchangeAggregationStrategy does, and given what I believe the JMS
component does (only uses body?).

So what I'm wondering is...does Camel support what I'm trying to do?  I
could obviously write my own bundling and un-bundling logic, but I was
hoping to get that out of the box for free, but of course!  Wishful
thinking?

Thanks!

--
View this message in context: 
http://camel.465427.n5.nabble.com/aggregate-split-with-JMS-possible-tp4375238p4375238.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to