mirror of https://github.com/apache/activemq.git
Forced to copy message before leaving the consumer - as the destination could change if
the message is forwarded on. git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@374795 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e1bc55dafe
commit
641140ebab
|
@ -415,7 +415,7 @@ public class ActiveMQMessageConsumer implements MessageAvailableConsumer, StatsC
|
|||
* @return
|
||||
*/
|
||||
private ActiveMQMessage createActiveMQMessage(final MessageDispatch md) {
|
||||
ActiveMQMessage m = (ActiveMQMessage) md.getMessage();
|
||||
ActiveMQMessage m = (ActiveMQMessage) md.getMessage().copy();
|
||||
if (session.isClientAcknowledge()) {
|
||||
m.setAcknowledgeCallback(new Callback() {
|
||||
public void execute() throws Throwable {
|
||||
|
@ -623,6 +623,7 @@ public class ActiveMQMessageConsumer implements MessageAvailableConsumer, StatsC
|
|||
|
||||
// Acknowledge the last message.
|
||||
MessageDispatch lastMd = (MessageDispatch) deliveredMessages.get(0);
|
||||
System.err.println(this + " ACKING " + lastMd.getMessage().getMessageId() + " size = " + deliveredMessages.size());
|
||||
MessageAck ack = new MessageAck(lastMd, MessageAck.STANDARD_ACK_TYPE, deliveredMessages.size());
|
||||
if (session.isTransacted()) {
|
||||
session.doStartTransaction();
|
||||
|
|
Loading…
Reference in New Issue