Skip to content

Commit

Permalink
ARTEMIS-5042 don't throw Exception when clearing cluster-connection b…
Browse files Browse the repository at this point in the history
…indings

Throwing an exception when clearing the bindings when a
cluster-connection is closed short-circuits the clearing (and closing)
process. This commit fixes that by simply logging the failure to clear
and continues on.

No new tests are added with this commit. It relies on existing tests.
  • Loading branch information
jbertram committed Sep 23, 2024
1 parent 4a80671 commit a26e491
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1621,4 +1621,7 @@ void noQueueIdDefined(org.apache.activemq.artemis.api.core.Message message,

@LogMessage(id = 224139, value = "Failed to stop bridge: {}", level = LogMessage.Level.ERROR)
void errorStoppingBridge(String bridgeName, Exception e);

@LogMessage(id = 224140, value = "Clearing bindings on cluster-connection {} failed to remove binding {}: {}", level = LogMessage.Level.WARN)
void clusterConnectionFailedToRemovingBindingOnClear(String clusterConnection, String binding, String exceptionMessage);
}
Original file line number Diff line number Diff line change
Expand Up @@ -1245,10 +1245,14 @@ private synchronized void doProposalResponseReceived(final ClientMessage message
server.getGroupingHandler().sendProposalResponse(response, hops + 1);
}

private synchronized void clearBindings() throws Exception {
private synchronized void clearBindings() {
logger.debug("{} clearing bindings", ClusterConnectionImpl.this);
for (RemoteQueueBinding binding : new HashSet<>(bindings.values())) {
removeBinding(binding.getClusterName());
try {
removeBinding(binding.getClusterName());
} catch (Exception e) {
ActiveMQServerLogger.LOGGER.clusterConnectionFailedToRemovingBindingOnClear(getName().toString(), binding.getClusterName().toString(), e.getMessage());
}
}
}

Expand Down

0 comments on commit a26e491

Please sign in to comment.