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.
(cherry picked from commit b2327db3b7
)
This commit is contained in:
parent
7f5c09f2d7
commit
8393e6b8ea
|
@ -835,7 +835,11 @@ public class Queue extends BaseDestination implements Task, UsageListener, Index
|
||||||
if (store != null && message.isPersistent()) {
|
if (store != null && message.isPersistent()) {
|
||||||
message.getMessageId().setFutureOrSequenceLong(null);
|
message.getMessageId().setFutureOrSequenceLong(null);
|
||||||
try {
|
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());
|
result = store.asyncAddQueueMessage(context, message, isOptimizeStorage());
|
||||||
final PendingMarshalUsageTracker tracker = new PendingMarshalUsageTracker(message);
|
final PendingMarshalUsageTracker tracker = new PendingMarshalUsageTracker(message);
|
||||||
result.addListener(new Runnable() {
|
result.addListener(new Runnable() {
|
||||||
|
|
Loading…
Reference in New Issue