Hi

Have you seen the section on the Camel JMS doc page about
request/reply over JMS?


On Sun, Apr 15, 2012 at 8:02 PM, garrydias <garryd...@gmail.com> wrote:
> I need to send messages to a JMS queue (jboss-messaging) and consume it in a
> sync way.

I assume you mean request/reply over JMS, where the caller waits for the reply?


> 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.
>

If you do request/reply over a JMS queue, you need a consumer on the
processingQueue to pickup the incoming message, process that message,
and send back the reply according to the JMSReplyTo header. If not
then there is no reply going back to the caller, and it will timeout.
Camel timeout by default after 20 seconds.

> 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.
>

What do you want to do? If you disableReplyTo then you do not do
request/reply over JMS. But use one-way messaging.
That is an Event Message in the EIP terms
http://camel.apache.org/event-message.html



> 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.



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to