I need to send messages to a JMS queue (jboss-messaging) and consume it in a
sync way.
I´ve tried this this first approach:

                <camel:route id="someRoute">
                        <camel:from uri="direct:inDoor" />
                        <camel:to
uri="jms:queue:processingQueue?disableReplyTo=true&amp;preserveMessageQos=true&amp;concurrentConsumers=5"
/>
                        <camel:to uri="bean:payloadProcessor?method=process" />
                </camel:route>

This approach provides me 2 advantages and 1 (adn awful) disadvantage:
- /advantage 1/- the route ends when payloadProcessor endpoint consumes the
message(sync consumption);
- /advantage 2/- consume around 100 messages per second;
- /disadvantage /- the message is not consumed from processingQueue. When I
check the processingQueue MBean at JBoss JMX-Console the Message Count
property grows for each message sent to direct:inDoor. To consume these
messages, I should deploy a route with
*uri="jms:queue:processingQueue?disableReplyTo=false&amp;preserveMessageQos=true&amp;concurrentConsumers=5"*
in the /from/ element.

Trying to solve the not consumed messages problem I tried to deploy this
approach:

                <camel:route id="someRoute">
                        <camel:from uri="direct:inDoor" />
                        <camel:to
uri="jms:queue:processingQueue?disableReplyTo=true&amp;preserveMessageQos=true&amp;concurrentConsumers=5"
/>
                </camel:route>
                <camel:route id="someRouteConsumption">
                        <camel:from
uri="jms:queue:processingQueue?disableReplyTo=true&amp;preserveMessageQos=true&amp;concurrentConsumers=5"
/>
                        <camel:to uri="bean:payloadProcessor?method=process" />
                </camel:route>

That approach could not provide me any advantage because when
*someRoute*ends *someRouteConsumption* runs asynchronously. Although it can
consume around 100 messages per second (like first approach) it´s not what I
want.

So my last approach was take the second approach and change disableReplyTo
to false:

                <camel:route id="someRoute">
                        <camel:from uri="direct:inDoor" />
                        <camel:to
uri="jms:queue:processingQueue?disableReplyTo=false&amp;preserveMessageQos=true&amp;concurrentConsumers=5"
/>
                </camel:route>
                <camel:route id="someRouteConsumption">
                        <camel:from
uri="jms:queue:processingQueue?disableReplyTo=false&amp;preserveMessageQos=true&amp;concurrentConsumers=5"
/>
                        <camel:to uri="bean:payloadProcessor?method=process" />
                </camel:route>

It´s work exactly as I want but.... consumes 1 message each 2 seconds or
more and sometimes I lose some messages due a timeout exception.

I thought this slow was due to several things that happens behind ths
scenes(creation of a temporary replyto queue, etc) and created my own reply
to queue to accelerate the process. I had set a replyto queue to my uri,
deployed my app and... the message cunsumption is still slow.

Please, if there´s a solution to consume the messages from /processingQueue
/using my first approach I´ll be thankful. If it´s impossible, how can I
accelerate my third approach?

Thanks


--
View this message in context: 
http://camel.465427.n5.nabble.com/Too-slow-JMS-pipeline-when-disableReplyTo-false-tp5642225p5642225.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to