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

Websocket transport options do not get applied

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

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.15.16, 5.18.3, 5.17.6, 5.16.7
    • 6.0.0, 5.18.4, 5.17.7, 5.16.8
    • Transport
    • None

    Description

      Configure broker transport connector like this:

      <transportConnector name="amqpws" uri="ws://0.0.0.0:5680?amqp.traceFrames=true&amp;wireFormat=amqp&amp;wireFormat.transformer=jms&amp;wireFormat.allowNonSaslConnections=true"/> 

       
      Try to connect to this instance with rhea.js library.
      First attempt to connect would be successful.
      Second and all subsequent attempts would fail.
      The only way to "fix" this would be a broker restart.
       
      The issue is here:
      https://github.com/apache/activemq/blob/4bbb055187166706103d785e9665efb439792c51/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty9/WSServlet.java#L162
       
      transportOptions would be "consumed" by introspection on the first connection attempt, and on subsequent attempts "allowNonSaslConnections" and "transformer" would not be there, so won't be applied to wireformat and the result would be an error.
       
      Interestingly this was already spotted and fixed in the same class for MQTT subprotocol here:
      https://github.com/apache/activemq/blob/4bbb055187166706103d785e9665efb439792c51/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty9/WSServlet.java#L115C86-L115C86
      by simply creating a copy of transport options before sending it into introspecting setters.
       
      Please apply the same fix.

      Attachments

        Activity

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

          People

            jbonofre Jean-Baptiste Onofré
            chaostya Kostiantyn Miklevskyi
            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