You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by titou10 <ti...@gmail.com> on 2016/03/26 15:38:49 UTC

JMS browser.getEnumeration().hasMoreElements() takes 15s+ on last element

Hi,
I have a problem with a JMS QueueBrowser after the browsing of the last
message
In the following piece of code, I browse a Q that has 3 messages. Browsing
the 3 messages takes a few milliseconds, but the process hangs for seconds
(usually from 10s to 15s+..) on the last msgs.hasMoreElements() before it
returns false..
After googling for a while, it seems that some other people have the same
problem, but I was not able to find an explanation nor a solution for this

ANy help is welcome

The server is ActiveMQ v5.11.1, fresh install with no specific
configuration/tuning

Denis (Author of JMSToolBox)



The client runs on J2SE 1.7 and the session is created like this





--
View this message in context: http://activemq.2283324.n4.nabble.com/JMS-browser-getEnumeration-hasMoreElements-takes-15s-on-last-element-tp4709969.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: JMS browser.getEnumeration().hasMoreElements() takes 15s+ on last element

Posted by titou10 <ti...@gmail.com>.
In addition to my initial post, here are the logs on the client side:

You can see in this run that there is a 22s gap at some point of the
execution and those logs seem to be related to transaction management
Could it be a transaction problem?





--
View this message in context: http://activemq.2283324.n4.nabble.com/JMS-browser-getEnumeration-hasMoreElements-takes-15s-on-last-element-tp4709969p4709970.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: JMS browser.getEnumeration().hasMoreElements() takes 15s+ on last element

Posted by titou10 <ti...@gmail.com>.
Thanks for your answer

- The behavior is the same with the latest version of the server (v5.13.2)

- I found a way to make it work as expected:

With this set on the connection factory, the last hasMoreElement() call
comes back immediately.
I'm not sure if it is safe to use this setting or not and what are the
possible consequences of using it
This code is part of JMSToolBox (on sourceforge) and it is designed to work
with all the recent versions of ActiveMQ, and various common
configuration/settings on the server side





--
View this message in context: http://activemq.2283324.n4.nabble.com/JMS-browser-getEnumeration-hasMoreElements-takes-15s-on-last-element-tp4709969p4709972.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: JMS browser.getEnumeration().hasMoreElements() takes 15s+ on last element

Posted by Timothy Bish <ta...@gmail.com>.
On 03/26/2016 10:38 AM, titou10 wrote:
> Hi,
> I have a problem with a JMS QueueBrowser after the browsing of the last
> message
> In the following piece of code, I browse a Q that has 3 messages. Browsing
> the 3 messages takes a few milliseconds, but the process hangs for seconds
> (usually from 10s to 15s+..) on the last msgs.hasMoreElements() before it
> returns false..
> After googling for a while, it seems that some other people have the same
> problem, but I was not able to find an explanation nor a solution for this
>
> ANy help is welcome
>
> The server is ActiveMQ v5.11.1, fresh install with no specific
> configuration/tuning
>
> Denis (Author of JMSToolBox)
>
>
>
> The client runs on J2SE 1.7 and the session is created like this
>
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/JMS-browser-getEnumeration-hasMoreElements-takes-15s-on-last-element-tp4709969.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
The latest release is 5.13.2, would be good to start there first, might 
already be taken care of.  Otherwise a unit test to reproduce is a good 
start.

-- 
Tim Bish
twitter: @tabish121
blog: http://timbish.blogspot.com/