Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-7899

[Java 0-8...0-9-1 Client] Message#setJMSCorrelationIDAsBytes() erroneously converts the bytes to string

    XMLWordPrintableJSON

Details

    Description

      The client converts the byte[] passed in to javax.jms.Message#setJMSCorrelationIDAsBytes to a String via new String(bytes);.
      If the bytes are not the encoding of a String in the current default encoding (in which case why would you use this method in the first place), this is wrong.
      In the JMS API implementation of setJMSCorrelationIDAsBytes()/getJMSCorrelationIDAsBytes() is optional and it explicitly allows the provider to throw java.lang.UnsupportedOperationException.

      We should either pack the raw bytes into the AMQShortString or throw UnsupportedOperationException.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lorenz.quack Lorenz Quack
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: