mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-5354 - patch applied with thanks
This commit is contained in:
parent
8ab9a56d35
commit
a0c42a61dd
|
@ -1369,13 +1369,16 @@ public abstract class MessageDatabase extends ServiceSupport implements BrokerSe
|
||||||
|
|
||||||
Long id = sd.messageIdIndex.get(tx, command.getMessageId());
|
Long id = sd.messageIdIndex.get(tx, command.getMessageId());
|
||||||
if (id != null) {
|
if (id != null) {
|
||||||
sd.orderIndex.put(
|
MessageKeys previousKeys = sd.orderIndex.put(
|
||||||
tx,
|
tx,
|
||||||
command.getPrioritySupported() ? command.getPriority() : javax.jms.Message.DEFAULT_PRIORITY,
|
command.getPrioritySupported() ? command.getPriority() : javax.jms.Message.DEFAULT_PRIORITY,
|
||||||
id,
|
id,
|
||||||
new MessageKeys(command.getMessageId(), location)
|
new MessageKeys(command.getMessageId(), location)
|
||||||
);
|
);
|
||||||
sd.locationIndex.put(tx, location, id);
|
sd.locationIndex.put(tx, location, id);
|
||||||
|
if(previousKeys != null) {
|
||||||
|
sd.locationIndex.remove(tx, previousKeys.location);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
LOG.warn("Non existent message update attempt rejected. Destination: {}://{}, Message id: {}", command.getDestination().getType(), command.getDestination().getName(), command.getMessageId());
|
LOG.warn("Non existent message update attempt rejected. Destination: {}://{}, Message id: {}", command.getDestination().getType(), command.getDestination().getName(), command.getMessageId());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue