[
https://issues.apache.org/jira/browse/AMQ-3949?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13424788#comment-13424788
]
Gary Tully commented on AMQ-3949:
---------------------------------
that copy is to protect access to the message content which is unmarshalled on
demand without sync, eg: the message properties.
Also, transformers are per consumer.
If each consumer wants to see a single readonly instance of the message, doing
a single unmarshal in-place of a copy would work, but would require a sync on
connection dispatch for the duration.
> Why ActiveMQMessageConsumer.dispatch copies message per listener
> ----------------------------------------------------------------
>
> Key: AMQ-3949
> URL: https://issues.apache.org/jira/browse/AMQ-3949
> Project: ActiveMQ
> Issue Type: Improvement
> Reporter: Martin Chan Shu Ching
> Priority: Minor
>
> When the consumer receives a topic message, the message is copied in
> ActiveMQMessageConsumer.dispatch() line 1294. If there are 10 consumers, the
> message will be copied 10 times. Wondering if that's really necessary to copy
> the content because we are doing performance tuning in our applications and
> found there is high memory usage in the MQ layer.
> line:1294
> ActiveMQMessage message = createActiveMQMessage(md);
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira