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

AMQPMessage missing ApplicationProperties from custom transformer

    XMLWordPrintableJSON

    Details

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

      Description

      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

      https://github.com/apache/activemq-artemis/commit/e065e3e960ac8cc6505a71ec4f67b58b4ffb5990#diff-4a5cefc3ba360bce9985ad42fc0c2231R698

       

      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.

      Scenario:

      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.

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ldebello Luis Miguel De Bello
            • 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 - 13h 40m
                13h 40m