From efa48c9782d5e6b91dcdb59949d4ac58c8df1db8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Andr=C3=A9=20Pearce?= Date: Thu, 7 Feb 2019 17:19:23 +0000 Subject: [PATCH] ARTEMIS-2081 listConfiguredQueues returns only queues created by config Move configuration managed in persister before consumer dispatch so then the fix can be applied in 2.6.x branch safely. --- .../codec/PersistentQueueBindingEncoding.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/PersistentQueueBindingEncoding.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/PersistentQueueBindingEncoding.java index 570a7fcb40..0f974aa175 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/PersistentQueueBindingEncoding.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/PersistentQueueBindingEncoding.java @@ -326,6 +326,11 @@ public class PersistentQueueBindingEncoding implements EncodingSupport, QueueBin } else { lastValue = ActiveMQDefaultConfiguration.getDefaultLastValue(); } + if (buffer.readableBytes() > 0) { + configurationManaged = buffer.readBoolean(); + } else { + configurationManaged = false; + } if (buffer.readableBytes() > 0) { consumersBeforeDispatch = buffer.readInt(); } else { @@ -336,11 +341,6 @@ public class PersistentQueueBindingEncoding implements EncodingSupport, QueueBin } else { delayBeforeDispatch = ActiveMQDefaultConfiguration.getDefaultDelayBeforeDispatch(); } - if (buffer.readableBytes() > 0) { - configurationManaged = buffer.readBoolean(); - } else { - configurationManaged = false; - } if (buffer.readableBytes() > 0) { lastValueKey = buffer.readNullableSimpleString(); } else { @@ -365,9 +365,9 @@ public class PersistentQueueBindingEncoding implements EncodingSupport, QueueBin buffer.writeByte(routingType); buffer.writeBoolean(exclusive); buffer.writeBoolean(lastValue); + buffer.writeBoolean(configurationManaged); buffer.writeInt(consumersBeforeDispatch); buffer.writeLong(delayBeforeDispatch); - buffer.writeBoolean(configurationManaged); buffer.writeNullableSimpleString(lastValueKey); buffer.writeBoolean(nonDestructive); } @@ -382,9 +382,9 @@ public class PersistentQueueBindingEncoding implements EncodingSupport, QueueBin DataConstants.SIZE_BYTE + DataConstants.SIZE_BOOLEAN + DataConstants.SIZE_BOOLEAN + + DataConstants.SIZE_BOOLEAN + DataConstants.SIZE_INT + DataConstants.SIZE_LONG + - DataConstants.SIZE_BOOLEAN + SimpleString.sizeofNullableString(lastValueKey) + DataConstants.SIZE_BOOLEAN; }