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

Message body is read-only exception when setting property on Bytes message

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.x
    • 5.16.0
    • JMS client
    • None

    Description

      In Zipkin's Brave instrumentation for JMS clients, we are currently having issues on adding properties to ActiveMQ BytesMessage <https://github.com/openzipkin/brave/issues/967>

       

       While setting String property on `ActiveMQMessage` works fine, setting String property on `ActiveMQBytesMessage` throws "Message body is read-only exception".

       

      Checking the source code `ActiveMQMessage` only checks if properties are read-only: https://github.com/apache/activemq/blob/master/activemq-client/src/main/java/org/apache/activemq/command/ActiveMQMessage.java#L493-L495

       

      While `ActiveMQBytesMessage` check if body is read-only when setting property: https://github.com/apache/activemq/blob/master/activemq-client/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java#L917 calling https://github.com/apache/activemq/blob/master/activemq-client/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java#L834

       

      Would love if someone can clarify if this is actually a bug and how to deal with this scenario if it is not.

       

      Attachments

        Issue Links

          Activity

            People

              jbonofre Jean-Baptiste Onofré
              jeqo Jorge Esteban Quilcate Otoya
              Votes:
              2 Vote for this issue
              Watchers:
              7 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