activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timothy Bish (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AMQ-4845) ActiveMQQueueReceiver.receive(1L) method not returning messages with timeout value of 1L
Date Mon, 04 Nov 2013 16:07:17 GMT

    [ https://issues.apache.org/jira/browse/AMQ-4845?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13812948#comment-13812948
] 

Timothy Bish commented on AMQ-4845:
-----------------------------------

This is not a bug, its working as designed.  You cannot rely on the timed receive calls to
always return a message, especially with such a short delay.  These care are no polling, if
a message is available on the client side or the broker sends one down before the timeout
then you'd get it.  When using timed receive calls you must code defensively as you have no
guarantee that you will get a message.  

> ActiveMQQueueReceiver.receive(1L) method not returning messages with timeout value of
1L
> ----------------------------------------------------------------------------------------
>
>                 Key: AMQ-4845
>                 URL: https://issues.apache.org/jira/browse/AMQ-4845
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.8.0
>         Environment: Windows 7 64bit. Client and server in the same box.
>            Reporter: Andres Candal
>         Attachments: TestMessagingSendReceive.java, jms-sync-queue-app-context.xml
>
>
> Calling the method ActiveMQQueueReceiver.receive with param timeout=1L doesn´t allways
return pending messages. Debugging works, it seems to be a latency or timing issue that doesn't
affect debugging as debugging is slower than running the code without debugger.
> I attach Spring Template based test case but the issue occurs also with direct api call.
Changing the timeout param to 100L works perfectly.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message