mirror of https://github.com/apache/activemq.git
Disabling async queue message store when persistJMSRedelivered is turned on for a destination. That flag will cause a sync update later on dispatch which can cause a race condition if the original message add is processed after the update. This can cause a duplicate message to be stored.
This commit is contained in:
parent
993d561947
commit
b2327db3b7
|
@ -833,7 +833,11 @@ public class Queue extends BaseDestination implements Task, UsageListener, Index
|
|||
if (store != null && message.isPersistent()) {
|
||||
message.getMessageId().setFutureOrSequenceLong(null);
|
||||
try {
|
||||
if (messages.isCacheEnabled()) {
|
||||
//AMQ-6133 - don't store async if using persistJMSRedelivered
|
||||
//This flag causes a sync update later on dispatch which can cause a race
|
||||
//condition if the original add is processed after the update, which can cause
|
||||
//a duplicate message to be stored
|
||||
if (messages.isCacheEnabled() && !isPersistJMSRedelivered()) {
|
||||
result = store.asyncAddQueueMessage(context, message, isOptimizeStorage());
|
||||
final PendingMarshalUsageTracker tracker = new PendingMarshalUsageTracker(message);
|
||||
result.addListener(new Runnable() {
|
||||
|
|
Loading…
Reference in New Issue