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)) {