[
https://issues.apache.org/jira/browse/ARTEMIS-2316?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
clebert suconic closed ARTEMIS-2316.
------------------------------------
Resolution: Not A Problem
> AMQPMessage missing ApplicationProperties from custom transformer
> -----------------------------------------------------------------
>
> Key: ARTEMIS-2316
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2316
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Reporter: Luis Miguel De Bello
> Priority: Major
> Fix For: 2.8.0
>
> Time Spent: 13h 40m
> Remaining Estimate: 0h
>
> 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.
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)