Its very likely related to that you use transacted so all messages
that are sent to a jms queue from the same TX (eg using the same
thread which is required by spring tx manager to orchestrate in same
tx). and hence only when the tx is committed at the end, the messages
you sent to the jms queue is "available" for consumers to pickup.

So when you turn on parallel, then the other threads send to the jms
queue are not orchestrate in the TX and therefore these messages are
available for consumers asap.




On Wed, Feb 19, 2014 at 5:45 PM, BlackTie <jts...@hotmail.com> wrote:
> Sure, here is the route:
>
> from("jms:queue:csv-request?maxConcurrentConsumers=1")
>    .transacted("propagationRequired")
>    .process(uriToFileProcessor)
>    .split().tokenize("\n",
> 1).streaming().parallelProcessing().stopOnException().shareUnitOfWork()
>       .choice().when(simple("${property.CamelSplitIndex} > 1"))
>          .log(LoggingLevel.DEBUG, "Creating order with: ${body}")
>          .to("bean:orderManager?method=createOrder")
>          .log(LoggingLevel.DEBUG, "queuing order on prepare-order: ${body}")
>          .inOnly("jms:queue:prepare-order").endChoice()
>       .otherwise().log(LoggingLevel.DEBUG, "Header: ${body}").endChoice()
>       .end() // ends choice
>    .end(); // ends split
>
> In a separate route builder, I have:
> from("jms:queue:prepare-order?maxConcurrentConsumers=20")
>    .transacted("propagationRequired")
>    .log(LoggingLevel.DEBUG, "Preparing order: ${body}")
>    .to("bean:orderManager?method=prepare");
>
> This isn't a copy/paste of the route, but I've brought over all the
> important bits.  I've removed some validation and logging calls, removed
> onException calls, replaced constants with strings, etc.  I tried to trim it
> down to the essentials.
>
> The transaction policy "propagationRequired" is needed because the app has
> more than one PlatformTransactionManager.
>
> URIs of CSV files are sent to the csv-request queue.  These CSV files can
> have thousands of lines in them.  If parallelProcessing is
> removed/commented/disabled, the logging will show the statements for
> creating and queuing the order, but the prepare-order route's logging won't
> start showing up until the entire file has been split.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Unexpected-behavior-with-splitter-tp5747564p5747578.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io

Reply via email to