Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-624

Corrupted payload with redelivered messages when transformer is jms



    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: proton-0.7
    • Fix Version/s: proton-0.8
    • Component/s: proton-j
    • Labels:
    • Environment:
      ActiveMQ broker with amqp transportConnector transport.transformer=jms


      In the contrib\proton-jms module (used by ActiveMQ), the JMSMappingOutboundTransformer is missing a reset call needed to make sure the BytesMessage is readable for future calls to readBytes(). The result is that redelivered messages from the broker to AMQP consumers have a payload of the correct length but with corrupted content (really all 0's as the content).

      To reproduce, call transform() in JMSMappingOutboundTransformer with a BytesMessage and then call it again with the same BytesMessage object. The body of the second EncodedMessage will be filled with 0's instead of having the real payload. To reproduce with ActiveMQ, configure the amqp transportConnector with transport.transformer=jms and then send a message into the broker. Once the message is assigned to a proton receiver (without acking it) close the connection and start another proton connection/receiver so the message will be redelivered to it. The payload should contain all 0's instead of the real payload.

      The other outbound transformer in proton-jms (AMQPNativeOutboundTransformer) makes the reset call as expected so it doesn't suffer from this bug. Based on that class the fix appears to be a one-liner to just add m.reset() after m.readBytes(data).

      The component is really proton-jms rather than proton-j but that wasn't a choice in JIRA.


        1. bytes_message_reset.patch
          0.9 kB
          Jesse Fugitt

          Issue Links



              • Assignee:
                robbie Robbie Gemmell
                jfugitt Jesse Fugitt
              • Votes:
                0 Vote for this issue
                3 Start watching this issue


                • Created: