You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Peter Eisenlohr (JIRA)" <ji...@apache.org> on 2013/12/17 23:40:06 UTC

[jira] [Commented] (AMQ-4938) Queue Messages lost after read timeout on REST API.

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

Peter Eisenlohr commented on AMQ-4938:
--------------------------------------

After enabling DEBUG logging, I found the following output after 
* starting the server clean
* wget --no-http-keep-alive -q -O - "http://localhost:8161/api/message/TEST?type=queue&clientId=GETID&readTimeout=1000"
* curl -d "body=message" "http://localhost:8161/api/message/TEST?type=queue"

{code}
2013-12-17 23:28:52,121 | DEBUG | Async client internal exception occurred with no exception listener registered: java.lang.IllegalStateException: IDLE,initial | org.apache.activemq.ActiveMQConnection | ActiveMQ Session Task-1
java.lang.IllegalStateException: IDLE,initial
        at org.eclipse.jetty.server.AsyncContinuation.dispatch(AsyncContinuation.java:408)
        at org.eclipse.jetty.server.AsyncContinuation.resume(AsyncContinuation.java:815)
        at org.apache.activemq.web.MessageServlet$Listener.onMessageAvailable(MessageServlet.java:395)
        at org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:1383)
        at org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:131)
        at org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:202)
        at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:129)
        at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:47)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:724)
2013-12-17 23:28:52,121 | DEBUG | Sent! to destination: queue://TEST message: ActiveMQTextMessage {commandId = 0, responseRequired = false, messageId = ID:turtle-52404-1387319318754-3:2:1:1:1, originalDestination = null, originalTransactionId = null, producerId = null, destination = queue://TEST, transactionId = null, expiration = 0, timestamp = 1387319332114, arrival = 0, brokerInTime = 0, brokerOutTime = 0, correlationId = null, replyTo = null, persistent = true, type = null, priority = 5, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = null, marshalledProperties = null, dataStructure = null, redeliveryCounter = 0, size = 0, properties = null, readOnlyProperties = f
{code}

Looks to me that the consuming session from the first wget is still there, in IDLE state -- but still is able to consume the message. Hope this helps -- I can't do any further testing or even debugging without a deeper understanding of ActiveMQ's internal workings.

> Queue Messages lost after read timeout on REST API.
> ---------------------------------------------------
>
>                 Key: AMQ-4938
>                 URL: https://issues.apache.org/jira/browse/AMQ-4938
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.8.0, 5.9.0, 5.10.0
>         Environment: Win32, Linux
>            Reporter: Peter Eisenlohr
>            Priority: Critical
>
> I have been trying to send/receive messages via a Queue using the [REST API|http://activemq.apache.org/rest.html]. While testing I found that some messages got lost after a consuming request times out when no message is available.
> Here is a transcript of the test case I used:
> {code}
> #
> # OK: send first, consume later
> #
> $ curl -d "body=message" "http://localhost:8161/api/message/TEST?type=queue"
> Message sent
> $ wget --no-http-keep-alive -q -O - "http://localhost:8161/api/message/TEST?type=queue&clientId=GETID&readTimeout=1000"
> message
> #
> # OK: start consuming, then send (within timeout)
> #
> $ wget --no-http-keep-alive -q -O - "http://localhost:8161/api/message/TEST?type=queue&clientId=GETID&readTimeout=5000"&
> [1] 5172
> $ curl -d "body=message" "http://localhost:8161/api/message/TEST?type=queue"
> messageMessage sent[1]+  Fertig                  wget --no-http-keep-alive -q -O - "http://localhost:8161/api/message/TEST?type=queue&clientId=GETID&readTimeout=5000"
> #
> # NOK: start consuming, wait for timeout, then send and consume again
> #
> $ wget --no-http-keep-alive -q -O - "http://localhost:8161/api/message/TEST?type=queue&clientId=GETID&readTimeout=5000"
> $ curl -d "body=message" "http://localhost:8161/api/message/TEST?type=queue"
> Message sent
> $ wget --no-http-keep-alive -q -O - "http://localhost:8161/api/message/TEST?type=queue&clientId=GETID&readTimeout=5000"
> {code}
> The last *wget* returns after the given read timeout without any message. When looking at the managament console, the message has been consumed.
> I tested this with 5.8.0 on linux as well as with 5.8.0, 5.9.0 and a freshly built 5.10.0 on windows.



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)