andytaylor commented on code in PR #4183:
URL: https://github.com/apache/activemq-artemis/pull/4183#discussion_r1053233756


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java:
##########
@@ -2340,10 +2318,24 @@ public Pair<SimpleString, EnumSet<RoutingType>> 
getAddressAndRoutingTypes(Simple
    }
 
    @Override
-   public void addProducer(ServerProducer serverProducer) {
+   public void addProducer(ServerProducer serverProducer, String address) {
+      if (address == null) {
+         //this is ok as it will be an anonymous producer which we dont track
+         return;
+      }
       serverProducer.setSessionID(getName());
-      serverProducer.setConnectionID(getConnectionID().toString());
-      producers.put(serverProducer.getID(), serverProducer);
+      serverProducer.setConnectionID(getConnectionID() != null ? 
getConnectionID().toString() : null);
+      producers.put(address, serverProducer);
+      if (CompositeAddress.isFullyQualified(address)) {
+         PostQueueDeletionCallback postQueueDeletionCallback = new 
PostQueueDeletionCallback() {
+            @Override
+            public void callback(SimpleString address, SimpleString queueName) 
throws Exception {
+               producers.remove(CompositeAddress.toFullyQualified(address, 
queueName).toString());
+               server.unregisterPostQueueDeletionCallback(this);

Review Comment:
   no longer valid



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to