tabish121 commented on code in PR #6083:
URL: https://github.com/apache/activemq-artemis/pull/6083#discussion_r2551127452


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/ServerSessionPacketHandler.java:
##########
@@ -706,33 +707,17 @@ private RoutingType 
getRoutingTypeFromAddress(SimpleString address) {
       return RoutingType.MULTICAST;
    }
 
-   private boolean requireNullResponseMessage_V1(Packet packet) {
-      return channel.getConnection().isVersionBeforeAsyncResponseChange();
-   }
-
-   private NullResponseMessage createNullResponseMessage_V1(Packet packet) {
-      assert requireNullResponseMessage_V1(packet);
-      return  poolNullResponse.borrow();
-   }
-
-   private NullResponseMessage_V2 createNullResponseMessage_V2(Packet packet) {
-      assert !requireNullResponseMessage_V1(packet);
-      NullResponseMessage_V2 response;
-      response = poolNullResponseV2.borrow();
+   private Packet createNullResponseMessage(Packet packet) {
+      NullResponseMessage response = poolNullResponse.borrow();
 
       // this should be already set by the channel too, but let's do it just 
in case
-      response.setCorrelationID(packet.getCorrelationID());
+      if (response instanceof NullResponseMessage_V2 v2) {

Review Comment:
   I'm not an expert on Core protocol handling but I wonder if you could add a 
no-op version of the setCorrelationID to the base NullResponseMessage such that 
each create call doesn't need to do this instanceof check?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to