You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Gary Tully (JIRA)" <ji...@apache.org> on 2017/06/02 09:35:04 UTC
[jira] [Commented] (AMQ-6695) MirrorQueue - send a copy to the
mirror topic instead of original message
[ https://issues.apache.org/jira/browse/AMQ-6695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16034386#comment-16034386 ]
Gary Tully commented on AMQ-6695:
---------------------------------
thanks for the patch.
Changes like this can be tricky (as in it will change behaviour for folks) - that code has not changed since 2007.
I think there should always be a copy of the message because sending does change the metadata and of course the usage.
From the comments on setCopyMessage it seems the intent is to set the forward destination on the copy, maybe that flags should just do that and there is always a copy.
Can you add some unit tests to show the problem and that can protect this changes into the future. Also verify the few unit tests that exercise the mirror queue
There is a related issue https://issues.apache.org/jira/browse/AMQ-3669 that seems to be in the same area and has a relevant test that can give inspiration.
> MirrorQueue - send a copy to the mirror topic instead of original message
> -------------------------------------------------------------------------
>
> Key: AMQ-6695
> URL: https://issues.apache.org/jira/browse/AMQ-6695
> Project: ActiveMQ
> Issue Type: Improvement
> Components: Broker
> Affects Versions: 5.x
> Reporter: Joachim Glink
> Priority: Minor
> Attachments: MirrorQueue___send_the_original_message_to_the_original_destination_and_a_copy_to_the_mirr.patch
>
>
> The MirrorQueue implementation currently sends the original message to the mirror topic and a copy (if copy flag is set to true) of the message to the requested destination.
> Also, the MemoryUsage on the message which is sent to the requested destination is set to null but the comment in the line notes that it´s done so the memory size is used from the queue instead of the topic which isn´t the case; its vise versa. (At least in my opinion)
> Another possible bug in my opinion is, that the MemoryUsage is set to null even if the copy flag is false; so the same message is sent to the mirror and destination but the MemoryUsage is set to null. This could lead to a false calculation of the broker storage.
> If there are further plugins configured, than these plugins see the original message in e.g. the send method. But this message isn´t the message which will be sent to the defined destination but the message which is sent to the mirror.
> I´d suggest to reverse the logic of the MirrorQueue so that a copy of the message is sent to the mirror topic and the original message to the requested destination (and also the MemoryUsage of this copy is set to null - and only if it´s a copy!)
> A patch is attached to this issue which would cover the changes.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)