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


##########
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);

Review Comment:
   I agree, using the address makes things problematic, the reason for doing 
this was because core has no notion of server side producers. AMQP has a hook 
when the receiver is created to add one and adds the producer id to each 
message. Openwire does something similar so I think we need to this into the 
core protocol. so this would entail;
   
   1. Creating a non blocking call when the client side producers are created 
and destroyed to create on the server.
   2. Add the producer id to each message sent.
   
   I will however need to address legacy clients so will continue to use the 
address for these when core is used. 



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