From 85843311981ce97d987f1a7f92394ca62ee2b771 Mon Sep 17 00:00:00 2001 From: Aleksei Eraskin Date: Fri, 17 Nov 2023 18:59:12 -0800 Subject: [PATCH] AMQ-140273 Message expired failure when the destination doesn't exist cr: https://code.amazon.com/reviews/CR-106421488 --- .../activemq/replica/ReplicaDestinationFilter.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/activemq-broker/src/main/java/org/apache/activemq/replica/ReplicaDestinationFilter.java b/activemq-broker/src/main/java/org/apache/activemq/replica/ReplicaDestinationFilter.java index 795cad4dbbd..aef8f2c1211 100644 --- a/activemq-broker/src/main/java/org/apache/activemq/replica/ReplicaDestinationFilter.java +++ b/activemq-broker/src/main/java/org/apache/activemq/replica/ReplicaDestinationFilter.java @@ -25,7 +25,6 @@ import org.apache.activemq.command.TransactionId; public class ReplicaDestinationFilter extends DestinationFilter { - private final boolean nextIsComposite; private final ReplicaSourceBroker sourceBroker; private final ReplicaRoleManagementBroker roleManagementBroker; @@ -55,6 +54,14 @@ public void send(ProducerBrokerExchange producerExchange, Message messageSend) t } } + @Override + public boolean canGC() { + if (ReplicaRole.source == roleManagementBroker.getRole()) { + return super.canGC(); + } + return false; + } + private void replicateSend(ProducerBrokerExchange producerExchange, Message messageSend) throws Exception { final ConnectionContext connectionContext = producerExchange.getConnectionContext(); if (!sourceBroker.needToReplicateSend(connectionContext, messageSend)) {