You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by gaohoward <gi...@git.apache.org> on 2018/04/27 12:25:52 UTC
[GitHub] activemq-artemis pull request #2049: NO-JIRA: Added a AMQP JMS LargeMessage ...
GitHub user gaohoward opened a pull request:
https://github.com/apache/activemq-artemis/pull/2049
NO-JIRA: Added a AMQP JMS LargeMessage test
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/gaohoward/activemq-artemis f_1461
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/activemq-artemis/pull/2049.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2049
----
commit 7ba4f75feeaf6c01e8a2ae7db63553741ab36960
Author: Howard Gao <ho...@...>
Date: 2018-04-27T12:22:28Z
NO-JIRA: Added a AMQP JMS LargeMessage test
----
---
[GitHub] activemq-artemis pull request #2049: NO-JIRA: Added a AMQP JMS LargeMessage ...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/activemq-artemis/pull/2049
---
[GitHub] activemq-artemis pull request #2049: NO-JIRA: Added a AMQP JMS LargeMessage ...
Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/2049#discussion_r184699818
--- Diff: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSDurableConsumerTest.java ---
@@ -221,4 +224,66 @@ public void testDurableConsumerUnsubscribeWhileActive() throws Exception {
connection.close();
}
}
+
+ @Test(timeout = 30000)
+ public void testDurableConsumerLarge() throws Exception {
+ String durableClientId = getTopicName() + "-ClientId";
+
+ Connection connection = createConnection(durableClientId);
+ try {
+ Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ Topic topic = session.createTopic(getTopicName());
+ final MessageConsumer consumer1 = session.createDurableSubscriber(topic, "DurbaleSub1");
+ final MessageConsumer consumer2 = session.createDurableSubscriber(topic, "DurbaleSub2");
+ MessageProducer producer = session.createProducer(topic);
+ producer.setDeliveryMode(DeliveryMode.PERSISTENT);
+ connection.start();
+
+ ObjectMessage objMessage = session.createObjectMessage();
+ BigObject bigObject = new BigObject(ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE);
+ objMessage.setObject(bigObject);
+ producer.send(objMessage);
+
+ final AtomicReference<Message> msg1 = new AtomicReference<>();
+ final AtomicReference<Message> msg2 = new AtomicReference<>();
+
+ assertTrue(Wait.waitFor(new Wait.Condition() {
+
+ @Override
+ public boolean isSatisfied() throws Exception {
+ msg1.set(consumer1.receiveNoWait());
+ return msg1.get() != null;
+ }
+ }, TimeUnit.SECONDS.toMillis(25), TimeUnit.MILLISECONDS.toMillis(200)));
--- End diff --
never mind.. I'm fixing it.
---
[GitHub] activemq-artemis pull request #2049: NO-JIRA: Added a AMQP JMS LargeMessage ...
Posted by gaohoward <gi...@git.apache.org>.
Github user gaohoward commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/2049#discussion_r184700517
--- Diff: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSDurableConsumerTest.java ---
@@ -221,4 +224,66 @@ public void testDurableConsumerUnsubscribeWhileActive() throws Exception {
connection.close();
}
}
+
+ @Test(timeout = 30000)
+ public void testDurableConsumerLarge() throws Exception {
+ String durableClientId = getTopicName() + "-ClientId";
+
+ Connection connection = createConnection(durableClientId);
+ try {
+ Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ Topic topic = session.createTopic(getTopicName());
+ final MessageConsumer consumer1 = session.createDurableSubscriber(topic, "DurbaleSub1");
+ final MessageConsumer consumer2 = session.createDurableSubscriber(topic, "DurbaleSub2");
+ MessageProducer producer = session.createProducer(topic);
+ producer.setDeliveryMode(DeliveryMode.PERSISTENT);
+ connection.start();
+
+ ObjectMessage objMessage = session.createObjectMessage();
+ BigObject bigObject = new BigObject(ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE);
+ objMessage.setObject(bigObject);
+ producer.send(objMessage);
+
+ final AtomicReference<Message> msg1 = new AtomicReference<>();
+ final AtomicReference<Message> msg2 = new AtomicReference<>();
+
+ assertTrue(Wait.waitFor(new Wait.Condition() {
+
+ @Override
+ public boolean isSatisfied() throws Exception {
+ msg1.set(consumer1.receiveNoWait());
+ return msg1.get() != null;
+ }
+ }, TimeUnit.SECONDS.toMillis(25), TimeUnit.MILLISECONDS.toMillis(200)));
--- End diff --
Thanks, I just copy/modify from other test and didn't think much of it. :)
---
[GitHub] activemq-artemis pull request #2049: NO-JIRA: Added a AMQP JMS LargeMessage ...
Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/2049#discussion_r184698179
--- Diff: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSDurableConsumerTest.java ---
@@ -221,4 +224,66 @@ public void testDurableConsumerUnsubscribeWhileActive() throws Exception {
connection.close();
}
}
+
+ @Test(timeout = 30000)
+ public void testDurableConsumerLarge() throws Exception {
+ String durableClientId = getTopicName() + "-ClientId";
+
+ Connection connection = createConnection(durableClientId);
+ try {
+ Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ Topic topic = session.createTopic(getTopicName());
+ final MessageConsumer consumer1 = session.createDurableSubscriber(topic, "DurbaleSub1");
+ final MessageConsumer consumer2 = session.createDurableSubscriber(topic, "DurbaleSub2");
+ MessageProducer producer = session.createProducer(topic);
+ producer.setDeliveryMode(DeliveryMode.PERSISTENT);
+ connection.start();
+
+ ObjectMessage objMessage = session.createObjectMessage();
+ BigObject bigObject = new BigObject(ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE);
+ objMessage.setObject(bigObject);
+ producer.send(objMessage);
+
+ final AtomicReference<Message> msg1 = new AtomicReference<>();
+ final AtomicReference<Message> msg2 = new AtomicReference<>();
+
+ assertTrue(Wait.waitFor(new Wait.Condition() {
+
+ @Override
+ public boolean isSatisfied() throws Exception {
+ msg1.set(consumer1.receiveNoWait());
+ return msg1.get() != null;
+ }
+ }, TimeUnit.SECONDS.toMillis(25), TimeUnit.MILLISECONDS.toMillis(200)));
--- End diff --
The Wait condition here is doing nothing.. you could simplify this a lot by just using consumer.receive(timeout);
---