Uploaded image for project: 'ActiveMQ Artemis'
  1. ActiveMQ Artemis
  2. ARTEMIS-2316

AMQPMessage missing ApplicationProperties from custom transformer



    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: None
    • Fix Version/s: 2.8.0
    • Component/s: None
    • Labels:


      We are working with Artemis 2.6.3 and we are trying to move to 2.7.0 after doing a quick test we found an issue introduced in 2.6.4.

      The same issue happens in 2.6.4 and 2.7.0

      If you have a custom transformer and include properties in a AMQPMessage in some scenarios they are lost because the reencode is not executed, this was change in the following commit



      As the flag is bufferValid is marked as true the "encodeProtonMessage();" is not execute because there is a check before executing it. I understand this was include for performance reason because the message was encoded multiples times.


      I have created a test were you can see the error and I made some changes to fix this. The idea is call the reencode method which is implemented only for AMQPMessage after doing a transform because the user can do whatever they want in the transform.


      Broker 1

      Broker 2


      Broker 1 Address .Provider..Agent.*.CustomNotification

      Broker 1 FrameworkNotifications

      Broker 2 BridgeNotifications

      Broker 2 Notifications


      Broker 1 Diverts from Address .Provider..Agent.*.CustomNotification to FrameworkNotifications

      It applies a custom transformer which include two properties ("A", "B")

      Broker 1 has a bridge to Broker 2 to BridgeNotifications

      It applies a custom transformer which include two properties ("C", "D")

      Broker 2 Diverts from BridgeNotifications to Notifications


      Produce AMQPMessage to Broker 1 to Address .Provider..Agent.*.CustomNotification

      Consume Message from Broker in Notifications


      Result: The message consume does not have these 4 properties.


      Note: At the beginning I thought I could remove the brigde to reproduce the issue and only produce and consume only one broker which some custom transformer, but this case works as expected because the message is in memory and have the properties. Although I think (I didnt validate this) the same could happen in the same broker if you have pagination to disk and the message got persisted.

      That  is the reason why I have added the reencode after divert transformer and bridge transformer.


      I will send a PR with this to get some discussion about this.





            • Assignee:
              ldebello Luis Miguel De Bello
            • Votes:
              0 Vote for this issue
              4 Start watching this issue


              • Created:

                Time Tracking

                Original Estimate - Not Specified
                Not Specified
                Remaining Estimate - 0h
                Time Spent - 13h 40m
                13h 40m