简体   繁体   English

JMS推动消费者延迟从Oralce AQ获取消息

[英]JMS Push Consumer delay in getting message from Oralce AQ

I have an application where I have implemented Oracle AQ. 我有一个已在其中实现Oracle AQ的应用程序。 I noticed that there is a delay of few seconds in consumption of message by JMS Push consumer, after message has been produced to AQ. 我注意到在将消息生成到AQ之后,JMS Push使用者对消息的使用会延迟几秒钟。

I ran this scenario where I produced a few messages in to AQ like 10 messages in an hour. 我在这种情况下运行,我在一小时内向AQ生成了一些消息,例如10条消息。 I noticed that there was a few seconds delay in consumption of message. 我注意到消息的使用延迟了几秒钟。 I calculated average delay time in such scenario and it came out to be 12 seconds and maximum delay time came out to be 13.5 seconds. 我计算了这种情况下的平均延迟时间,结果为12秒,最大延迟时间为13.5秒。

But when I increased my rate of production to 1000 messages in an hour. 但是当我将生产率提高到每小时一千条消息时。 I saw less delay in consumption. 我看到消费上的延迟减少了。 and I got an constant average of 5 seconds, with maximum delay of 5.2 seconds. 并且我得到了5秒的恒定平均值,最大延迟为5.2秒。

I can assume that there might be some sleep time for JMS consumer thread But I'm bit confused as I'm using Push consumer instead of Poll consumers. 我可以假设JMS使用者线程可能会有一些睡眠时间,但是当我使用Push使用者而不是Poll使用者时,我有点困惑。

Please help me to find out reason for such delay and how can I shorten this gap of time. 请帮助我找出造成这种延迟的原因,以及如何缩短时间间隔。

~Thanks 〜谢谢

On enabling ( -Doracle.jms.traceLevel=6 ) diagnostics logs for aq api. 启用( -Doracle.jms.traceLevel=6 )诊断日志时会使用aq api。

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. 如果无法使用消息,则AQjmsListenerWorker进入睡眠状态;如果不能使用消息,则睡眠时间每次都会翻倍(达到峰值限制)。

Analyzed that Listener thread sleep time doubles till 15000 ms (15 sec), starting with default value 1000 ms, if null message is received from AQ. 分析说,如果从AQ接收到空消息,则侦听器线程的睡眠时间将翻倍,直到15000 ms(15秒),从默认值1000 ms开始。

To reduce the sleep time set following system properties: 要减少睡眠时间,请设置以下系统属性:

oracle.jms.minSleepTime=100
oracle.jms.maxSleepTime=4000

Further details please refer: http://querydb.blogspot.in/2014/10/jms-consumer-onmessage-delay-in-getting.html 有关更多详细信息,请参阅: http : //querydb.blogspot.in/2014/10/jms-consumer-onmessage-delay-in-getting.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM