clebertsuconic commented on code in PR #4656:
URL: https://github.com/apache/activemq-artemis/pull/4656#discussion_r1374903741


##########
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerSenderContext.java:
##########
@@ -980,6 +983,19 @@ class DefaultController implements SenderController {
 
       @Override
       public Consumer init(ProtonServerSenderContext senderContext) throws 
Exception {
+         {
+            ProtonHandler handler;
+            Connection qpidConnection;
+            // Avoiding possible NPEs that could happen on mock tests
+            if (connection != null &&
+               (handler = connection.getHandler()) != null && (qpidConnection 
= handler.getConnection()) != null) {
+               if (qpidConnection.getRemoteState() == EndpointState.CLOSED) {
+                  logger.warn("AMQP Connection creating invalid consumer for 
closed connection", connection);
+                  throw new IllegalStateException("AMQP connection " + 
connection.getRemoteAddress() + " creating invalid consumer for closed 
connection");
+               }
+            }
+         }
+

Review Comment:
   fair enough... 
   
   I"m in the process to making it ready to be merged now.. and I will cleanup 
this before I set it ready to merge
   
   
   Thanks for looking into it.



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