You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2018/09/04 16:54:55 UTC

[1/2] activemq-artemis git commit: ARTEMIS-2073 - make sure connection gets set for interceptors

Repository: activemq-artemis
Updated Branches:
  refs/heads/master 2b633ee5c -> 2f6326068


ARTEMIS-2073 - make sure connection gets set for interceptors

https://issues.apache.org/jira/browse/ARTEMIS-2073


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/f4b77a2c
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/f4b77a2c
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/f4b77a2c

Branch: refs/heads/master
Commit: f4b77a2cb4a23241d8d0285a882cdc3cfb55601e
Parents: 2b633ee
Author: andytaylor <an...@gmail.com>
Authored: Tue Sep 4 11:16:35 2018 +0100
Committer: Clebert Suconic <cl...@apache.org>
Committed: Tue Sep 4 12:54:21 2018 -0400

----------------------------------------------------------------------
 .../ActiveMQProtonRemotingConnection.java       |  1 +
 .../amqp/AmqpSendReceiveInterceptorTest.java    | 46 ++++++++++++++++++++
 2 files changed, 47 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f4b77a2c/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/ActiveMQProtonRemotingConnection.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/ActiveMQProtonRemotingConnection.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/ActiveMQProtonRemotingConnection.java
index a37b7b7..41f6e78 100644
--- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/ActiveMQProtonRemotingConnection.java
+++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/ActiveMQProtonRemotingConnection.java
@@ -50,6 +50,7 @@ public class ActiveMQProtonRemotingConnection extends AbstractRemotingConnection
       super(transportConnection, executor);
       this.manager = manager;
       this.amqpConnection = amqpConnection;
+      transportConnection.setProtocolConnection(this);
    }
 
    public Executor getExecutor() {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f4b77a2c/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveInterceptorTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveInterceptorTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveInterceptorTest.java
index 20be85d..8dcb2bf 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveInterceptorTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveInterceptorTest.java
@@ -176,4 +176,50 @@ public class AmqpSendReceiveInterceptorTest extends AmqpClientTestSupport {
       receiver.close();
       connection.close();
    }
+
+   @Test(timeout = 60000)
+   public void testCheckRemotingConnection() throws Exception {
+      final CountDownLatch latch = new CountDownLatch(1);
+      final boolean[] passed = {false};
+      server.getRemotingService().addIncomingInterceptor(new AmqpInterceptor() {
+         @Override
+         public boolean intercept(AMQPMessage message, RemotingConnection connection) throws ActiveMQException {
+            passed[0] = connection != null;
+            latch.countDown();
+            return true;
+         }
+      });
+
+      AmqpClient client = createAmqpClient();
+      AmqpConnection connection = addConnection(client.connect());
+      AmqpSession session = connection.createSession();
+
+      AmqpSender sender = session.createSender(getTestName());
+      AmqpMessage message = new AmqpMessage();
+      message.setMessageId("msg" + 1);
+      message.setText("Test-Message");
+      sender.send(message);
+
+      assertTrue(latch.await(2, TimeUnit.SECONDS));
+      assertTrue("connection not set", passed[0]);
+
+      final CountDownLatch latch2 = new CountDownLatch(1);
+      server.getRemotingService().addOutgoingInterceptor(new AmqpInterceptor() {
+         @Override
+         public boolean intercept(AMQPMessage packet, RemotingConnection connection) throws ActiveMQException {
+            passed[0] = connection != null;
+            latch2.countDown();
+            return true;
+         }
+      });
+      AmqpReceiver receiver = session.createReceiver(getTestName());
+      receiver.flow(2);
+      AmqpMessage amqpMessage = receiver.receive(5, TimeUnit.SECONDS);
+      assertNotNull(amqpMessage);
+      assertEquals(latch2.getCount(), 0);
+      assertTrue("connection not set", passed[0]);
+      sender.close();
+      receiver.close();
+      connection.close();
+   }
 }


[2/2] activemq-artemis git commit: This closes #2288 This closes #2289

Posted by cl...@apache.org.
This closes #2288
This closes #2289


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/2f632606
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/2f632606
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/2f632606

Branch: refs/heads/master
Commit: 2f632606800799cccdc85c420aedf8fb86b2d01c
Parents: 2b633ee f4b77a2
Author: Clebert Suconic <cl...@apache.org>
Authored: Tue Sep 4 12:54:21 2018 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Tue Sep 4 12:54:31 2018 -0400

----------------------------------------------------------------------
 .../ActiveMQProtonRemotingConnection.java       |  1 +
 .../amqp/AmqpSendReceiveInterceptorTest.java    | 46 ++++++++++++++++++++
 2 files changed, 47 insertions(+)
----------------------------------------------------------------------