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

Concurrent access error attempting to consume messages via REST API in 5.18.2 or higher

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.18.2, 5.18.3, 5.18.4
    • 5.18.5, 6.1.3
    • None
    • None

    Description

      I am attempting to download a file from a queue via PowerShell. This can be done with the following 4 lines:

      $user="admin"
      $pass="admin" | ConvertTo-SecureString -AsPlainText -Force
      $cred = New-Object Management.Automation.PSCredential($user,$pass)
      $status = Invoke-WebRequest -Uri "http://localhost:8161/api/message/TestQueue?type=queue&clientId=Importer" -Credential $cred -ContentType "application/base64"

      When I do this using 5.18.1, it works and either downloads a file or times out after a short period if there are no files on the queue. When I run the same script against 5.18.2 or higher, I get the following error the first time I try to download a file after starting the broker:

      Invoke-WebRequest : HTTP ERROR 500 AsyncContext timeout
      URI:/api/message/TestQueue
      STATUS:500
      MESSAGE:AsyncContext timeout
      SERVLET:MessageServlet
      At line:1 char:11
      + $status = Invoke-WebRequest -Uri "http://localhost:8161/api/message/T ...
      +           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
         eption
          + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

      Then every time I try after that I get the following:

      Invoke-WebRequest : HTTP ERROR 500 javax.servlet.ServletException: javax.servlet.ServletException:
      javax.servlet.ServletException: Concurrent access to consumer is not supported
      URI:/api/message/TestQueue
      STATUS:500
      MESSAGE:javax.servlet.ServletException: javax.servlet.ServletException: javax.servlet.ServletException: Concurrent
      access to consumer is not supported
      SERVLET:MessageServlet
      CAUSED BY:javax.servlet.ServletException: javax.servlet.ServletException: javax.servlet.ServletException: Concurrent
      access to consumer is not supported
      CAUSED BY:javax.servlet.ServletException: javax.servlet.ServletException: Concurrent access to consumer is not
      supported
      CAUSED BY:javax.servlet.ServletException: Concurrent access to consumer is not supported
      Caused by:
      javax.servlet.ServletException: javax.servlet.ServletException: javax.servlet.ServletException: Concurrent access to
      consumer is not supported
              at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:162)
              at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
              at org.eclipse.jetty.server.Server.handle(Server.java:516)
              at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487)
              at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)
              at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)
              at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
              at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
              at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
              at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
              at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
              at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
              at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
              at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
              at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
              at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
              at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
              at java.base/java.lang.Thread.run(Thread.java:1583)
      Caused by: javax.servlet.ServletException: javax.servlet.ServletException: Concurrent access to consumer is not
      supported
              at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:162)
              at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:560)
              at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
              ... 17 more
      Caused by: javax.servlet.ServletException: Concurrent access to consumer is not supported
              at org.apache.activemq.web.MessageServlet.doMessages(MessageServlet.java:196)
              at org.apache.activemq.web.MessageServlet.doGet(MessageServlet.java:170)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:655)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
              at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
              at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:554)
              at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
              at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:560)
              at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
              at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
              at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
              at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
              at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440)
              at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
              at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:505)
              at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
              at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
              at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355)
              at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
              at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
              ... 19 more
      At line:1 char:11
      + $status = Invoke-WebRequest -Uri "http://localhost:8161/api/message/T ...
      +           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
         eption
          + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            cshannon Christopher L. Shannon
            smitha-cgi Andrew Smith
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0h
              0h
              Logged:
              Time Spent - 20m
              20m

              Slack

                Issue deployment