You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2020/02/06 18:17:10 UTC

[GitHub] [activemq-artemis] jbertram opened a new pull request #2974: ARTEMIS-2607 interceptor returns false but processing continues

jbertram opened a new pull request #2974: ARTEMIS-2607 interceptor returns false but processing continues
URL: https://github.com/apache/activemq-artemis/pull/2974
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [activemq-artemis] clebertsuconic commented on a change in pull request #2974: ARTEMIS-2607 interceptor returns false but processing continues

Posted by GitBox <gi...@apache.org>.
clebertsuconic commented on a change in pull request #2974: ARTEMIS-2607 interceptor returns false but processing continues
URL: https://github.com/apache/activemq-artemis/pull/2974#discussion_r377271568
 
 

 ##########
 File path: artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java
 ##########
 @@ -507,8 +507,9 @@ private void serverSend(final ProtonServerReceiverContext context,
                            final Receiver receiver,
                            final RoutingContext routingContext) throws Exception {
       message.setConnectionID(receiver.getSession().getConnection().getRemoteContainer());
-      invokeIncoming((AMQPMessage) message, (ActiveMQProtonRemotingConnection) transportConnection.getProtocolConnection());
-      serverSession.send(transaction, message, directDeliver, false, routingContext);
+      if (invokeIncoming((AMQPMessage) message, (ActiveMQProtonRemotingConnection) transportConnection.getProtocolConnection()) == null) {
+         serverSession.send(transaction, message, directDeliver, false, routingContext);
+      }
 
       afterIO(new IOCallback() {
 
 Review comment:
   not really... afterIO will wait any pending IO to be executed, or to be executed right away if there is no pending IO. in that sense if context is empty, it will execute in thread.
   
   That means that the confirmation (ack for the sends) will happen right away.
   
   
   I'm not sure what is the expected semantic from the user on this case.
   
   
   
   I would expect the disposition to be rejected on that case... and not accepted. from this POV this is being accepted as if the message was actually stored and delivered.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [activemq-artemis] clebertsuconic commented on a change in pull request #2974: ARTEMIS-2607 interceptor returns false but processing continues

Posted by GitBox <gi...@apache.org>.
clebertsuconic commented on a change in pull request #2974: ARTEMIS-2607 interceptor returns false but processing continues
URL: https://github.com/apache/activemq-artemis/pull/2974#discussion_r377085098
 
 

 ##########
 File path: artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java
 ##########
 @@ -507,8 +507,9 @@ private void serverSend(final ProtonServerReceiverContext context,
                            final Receiver receiver,
                            final RoutingContext routingContext) throws Exception {
       message.setConnectionID(receiver.getSession().getConnection().getRemoteContainer());
-      invokeIncoming((AMQPMessage) message, (ActiveMQProtonRemotingConnection) transportConnection.getProtocolConnection());
-      serverSession.send(transaction, message, directDeliver, false, routingContext);
+      if (invokeIncoming((AMQPMessage) message, (ActiveMQProtonRemotingConnection) transportConnection.getProtocolConnection()) == null) {
+         serverSession.send(transaction, message, directDeliver, false, routingContext);
+      }
 
       afterIO(new IOCallback() {
 
 Review comment:
   Did you think about the implications of the interceptor on the afterIO?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [activemq-artemis] jbertram commented on a change in pull request #2974: ARTEMIS-2607 interceptor returns false but processing continues

Posted by GitBox <gi...@apache.org>.
jbertram commented on a change in pull request #2974: ARTEMIS-2607 interceptor returns false but processing continues
URL: https://github.com/apache/activemq-artemis/pull/2974#discussion_r378434165
 
 

 ##########
 File path: artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java
 ##########
 @@ -507,8 +507,9 @@ private void serverSend(final ProtonServerReceiverContext context,
                            final Receiver receiver,
                            final RoutingContext routingContext) throws Exception {
       message.setConnectionID(receiver.getSession().getConnection().getRemoteContainer());
-      invokeIncoming((AMQPMessage) message, (ActiveMQProtonRemotingConnection) transportConnection.getProtocolConnection());
-      serverSession.send(transaction, message, directDeliver, false, routingContext);
+      if (invokeIncoming((AMQPMessage) message, (ActiveMQProtonRemotingConnection) transportConnection.getProtocolConnection()) == null) {
+         serverSession.send(transaction, message, directDeliver, false, routingContext);
+      }
 
       afterIO(new IOCallback() {
 
 Review comment:
   I reworked this a bit essentially reproducing what we do on core.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [activemq-artemis] asfgit closed pull request #2974: ARTEMIS-2607 interceptor returns false but processing continues

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #2974: ARTEMIS-2607 interceptor returns false but processing continues
URL: https://github.com/apache/activemq-artemis/pull/2974
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [activemq-artemis] clebertsuconic commented on a change in pull request #2974: ARTEMIS-2607 interceptor returns false but processing continues

Posted by GitBox <gi...@apache.org>.
clebertsuconic commented on a change in pull request #2974: ARTEMIS-2607 interceptor returns false but processing continues
URL: https://github.com/apache/activemq-artemis/pull/2974#discussion_r377271786
 
 

 ##########
 File path: artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java
 ##########
 @@ -507,8 +507,9 @@ private void serverSend(final ProtonServerReceiverContext context,
                            final Receiver receiver,
                            final RoutingContext routingContext) throws Exception {
       message.setConnectionID(receiver.getSession().getConnection().getRemoteContainer());
-      invokeIncoming((AMQPMessage) message, (ActiveMQProtonRemotingConnection) transportConnection.getProtocolConnection());
-      serverSession.send(transaction, message, directDeliver, false, routingContext);
+      if (invokeIncoming((AMQPMessage) message, (ActiveMQProtonRemotingConnection) transportConnection.getProtocolConnection()) == null) {
+         serverSession.send(transaction, message, directDeliver, false, routingContext);
+      }
 
       afterIO(new IOCallback() {
 
 Review comment:
   this is one of the reasons it was never captured at this point. but if you decide to take the outcome of the interceptor into consideration, then you need proper cancellations at the send.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [activemq-artemis] jbertram commented on a change in pull request #2974: ARTEMIS-2607 interceptor returns false but processing continues

Posted by GitBox <gi...@apache.org>.
jbertram commented on a change in pull request #2974: ARTEMIS-2607 interceptor returns false but processing continues
URL: https://github.com/apache/activemq-artemis/pull/2974#discussion_r377191428
 
 

 ##########
 File path: artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java
 ##########
 @@ -507,8 +507,9 @@ private void serverSend(final ProtonServerReceiverContext context,
                            final Receiver receiver,
                            final RoutingContext routingContext) throws Exception {
       message.setConnectionID(receiver.getSession().getConnection().getRemoteContainer());
-      invokeIncoming((AMQPMessage) message, (ActiveMQProtonRemotingConnection) transportConnection.getProtocolConnection());
-      serverSession.send(transaction, message, directDeliver, false, routingContext);
+      if (invokeIncoming((AMQPMessage) message, (ActiveMQProtonRemotingConnection) transportConnection.getProtocolConnection()) == null) {
+         serverSession.send(transaction, message, directDeliver, false, routingContext);
+      }
 
       afterIO(new IOCallback() {
 
 Review comment:
   In the case where the interceptor returns `false` I assumed the `IOCallback` wouldn't be invoked since `send` wasn't invoked. Is that not how it works?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [activemq-artemis] clebertsuconic commented on a change in pull request #2974: ARTEMIS-2607 interceptor returns false but processing continues

Posted by GitBox <gi...@apache.org>.
clebertsuconic commented on a change in pull request #2974: ARTEMIS-2607 interceptor returns false but processing continues
URL: https://github.com/apache/activemq-artemis/pull/2974#discussion_r377275846
 
 

 ##########
 File path: artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java
 ##########
 @@ -507,8 +507,9 @@ private void serverSend(final ProtonServerReceiverContext context,
                            final Receiver receiver,
                            final RoutingContext routingContext) throws Exception {
       message.setConnectionID(receiver.getSession().getConnection().getRemoteContainer());
-      invokeIncoming((AMQPMessage) message, (ActiveMQProtonRemotingConnection) transportConnection.getProtocolConnection());
-      serverSession.send(transaction, message, directDeliver, false, routingContext);
+      if (invokeIncoming((AMQPMessage) message, (ActiveMQProtonRemotingConnection) transportConnection.getProtocolConnection()) == null) {
+         serverSession.send(transaction, message, directDeliver, false, routingContext);
+      }
 
       afterIO(new IOCallback() {
 
 Review comment:
   this was well done, but the semantic here is wrong.. I think this should be -1
   
   unless we find the best definition here.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services