You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by fxthomas <fe...@gmail.com> on 2016/07/19 08:00:51 UTC

Time taken to read messages from queue

Hello, 

I want to know if there is a simple way in camel to measure the time taken
by route to read all messages present in the queue. Example My queue get
populated on some time intervals , so i want to know how time it took just
for the JMS component to read from the queue and not the full time cycle of
the exchange.
MY route as below

<route routePolicyRef="routeQueuePolicy" 
shutdownRunningTask="CompleteCurrentTaskOnly"  id="ProcessQueue" 
autoStartup="true">
    <from uri="wmq:queue:TESTQ2?acknowledgementMode=2"/>
        <doTry>
                 <to
uri="bean:routeQueueBean?method=parseQueueMessage(${body},'databasebean')"/>
                  <doCatch>
                        <exception>java.lang.Exception</exception>
                       <handled><constant>false</constant></handled>
                       <process ref="stopRouteProcessor"/>
                  </doCatch>
                 <aggregate strategyRef="queueBatchStrategy"
completionTimeout="3000" completionSize="100" completeAllOnStop="false">
        			<correlationExpression>
          				<constant>true</constant>
        			</correlationExpression>
                    <to
uri="bean:routeQueueBean?method=processQueueMessage('databasebean')"/>
                 </aggregate>
       </doTry>
  </route>

I want only the time taken by the route to read the all the messages in the
queue present at the time. Like a batch total time .

  



--
View this message in context: http://camel.465427.n5.nabble.com/Time-taken-to-read-messages-from-queue-tp5785225.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Time taken to read messages from queue

Posted by fxthomas <fe...@gmail.com>.
hello, 

I just want to mesaure how much camel JMS component take to read from queue,
I dont want the complete exchange time take. I think using a Bean I can
measure it which is the only clean option i see. 

Using grouplog of camel is an option, but I am not sure how many messages
are there in queue to set the counter for it.

Thanks.



--
View this message in context: http://camel.465427.n5.nabble.com/Time-taken-to-read-messages-from-queue-tp5785225p5785265.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Time taken to read messages from queue

Posted by Antoine DESSAIGNE <an...@gmail.com>.
Hello.

That's something that you may extract from your JMS queue itself.

That beeing said, if you have burst of data you can use the log component
to tell what's happening. For instance you can use
<to uri="log:activity?groupInterval=10000" />
It will tell you in the log, the number of exchange processed during the
last 10 seconds. When it reaches zero then you have read everything.

Hope this helps

Antoine

2016-07-19 10:00 GMT+02:00 fxthomas <fe...@gmail.com>:

> Hello,
>
> I want to know if there is a simple way in camel to measure the time taken
> by route to read all messages present in the queue. Example My queue get
> populated on some time intervals , so i want to know how time it took just
> for the JMS component to read from the queue and not the full time cycle of
> the exchange.
> MY route as below
>
> <route routePolicyRef="routeQueuePolicy"
> shutdownRunningTask="CompleteCurrentTaskOnly"  id="ProcessQueue"
> autoStartup="true">
>     <from uri="wmq:queue:TESTQ2?acknowledgementMode=2"/>
>         <doTry>
>                  <to
>
> uri="bean:routeQueueBean?method=parseQueueMessage(${body},'databasebean')"/>
>                   <doCatch>
>                         <exception>java.lang.Exception</exception>
>                        <handled><constant>false</constant></handled>
>                        <process ref="stopRouteProcessor"/>
>                   </doCatch>
>                  <aggregate strategyRef="queueBatchStrategy"
> completionTimeout="3000" completionSize="100" completeAllOnStop="false">
>                                 <correlationExpression>
>                                         <constant>true</constant>
>                                 </correlationExpression>
>                     <to
> uri="bean:routeQueueBean?method=processQueueMessage('databasebean')"/>
>                  </aggregate>
>        </doTry>
>   </route>
>
> I want only the time taken by the route to read the all the messages in the
> queue present at the time. Like a batch total time .
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Time-taken-to-read-messages-from-queue-tp5785225.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>