Skip to main content

Posts

Showing posts from October, 2014

JMS Consumer (onMessage()) delay in getting message from Oralce AQ

I have an application where I have implemented Oracle AQ. I ran in to a behavior where average time for processing varied as depicted in graph below: In above graph when volume of orders was less, average processing time came out to be more whereas when load increased with time, average time for processing got constant and then when volume started declining, time again started increasing. I analyzed the behavior and found that there is delay in message consumption after message has been produced to AQ. On further analysis I found that AQjmsListenerWorker goes for sleep if message is not available for consumption and sleep time doubles each time (up to peak limit) if message is not available for consumption. Thus optimizing resource utilization if there is no messages in AQ for consumption. On enabling ( -Doracle.jms.traceLevel=6 ) diagnostics logs for aq api.  I analyzed that Listener thread sleep time doubles till 15000 ms (15 sec), starting with default value 1000 ms,