Uploaded image for project: 'ActiveMQ'
  1. ActiveMQ
  2. AMQ-4938

Queue Messages lost after read timeout on REST API.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 5.8.0, 5.9.0, 5.10.0
    • Fix Version/s: 5.9.1, 5.10.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      Win32, Linux

      Description

      I have been trying to send/receive messages via a Queue using the REST API. 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:

      #
      # 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"
      

      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.

        Attachments

        1. AMQ-4938B.patch
          11 kB
          Arthur Naseef
        2. AMQ-4938.patch
          2 kB
          Arthur Naseef

          Activity

            People

            • Assignee:
              tabish Timothy A. Bish
              Reporter:
              psedi Peter Eisenlohr
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: