[GitHub] activemq-artemis pull request #2084: ARTEMIS-1859 Adding testAnonymousProduc...

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] activemq-artemis pull request #2084: ARTEMIS-1859 Adding testAnonymousProduc...

asfgit
GitHub user jdanekrh opened a pull request:

    https://github.com/apache/activemq-artemis/pull/2084

    ARTEMIS-1859 Adding testAnonymousProducerWithQueueAutoCreation

   

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jdanekrh/activemq-artemis jd_ARTEMIS-1859_anonymous_autocreate_queue

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/activemq-artemis/pull/2084.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 #2084
   
----
commit d35566ce11b75701aeaf663757eeec672e327e96
Author: Jiri Danek <jdanek@...>
Date:   2018-05-11T09:20:35Z

    ARTEMIS-1859 Adding testAnonymousProducerWithQueueAutoCreation

----


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] activemq-artemis pull request #2084: ARTEMIS-1859 Adding testAnonymousProduc...

asfgit
Github user gemmellr commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2084#discussion_r187566075
 
    --- Diff: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageProducerTest.java ---
    @@ -70,10 +70,31 @@ public void testAnonymousProducer() throws Exception {
        }
     
        @Test(timeout = 30000)
    -   public void testAnonymousProducerWithAutoCreation() throws Exception {
    -      Connection connection = createConnection();
    +   public void testAnonymousProducerWithQueueAutoCreation() throws Exception {
    +      try (Connection connection = createConnection()) {
    +         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
    +         Queue queue = session.createQueue(UUID.randomUUID().toString());
    +         MessageProducer p = session.createProducer(null);
     
    -      try {
    +         TextMessage message = session.createTextMessage();
    +         message.setText("hello");
    +         // this will auto-create the address
    +         p.send(queue, message);
    --- End diff --
   
    This send shouldn't be needed in this test since it would be a queue being created.


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] activemq-artemis pull request #2084: ARTEMIS-1859 Adding testAnonymousProduc...

asfgit
In reply to this post by asfgit
Github user jdanekrh commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2084#discussion_r187642736
 
    --- Diff: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageProducerTest.java ---
    @@ -70,10 +70,31 @@ public void testAnonymousProducer() throws Exception {
        }
     
        @Test(timeout = 30000)
    -   public void testAnonymousProducerWithAutoCreation() throws Exception {
    -      Connection connection = createConnection();
    +   public void testAnonymousProducerWithQueueAutoCreation() throws Exception {
    +      try (Connection connection = createConnection()) {
    +         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
    +         Queue queue = session.createQueue(UUID.randomUUID().toString());
    +         MessageProducer p = session.createProducer(null);
     
    -      try {
    +         TextMessage message = session.createTextMessage();
    +         message.setText("hello");
    +         // this will auto-create the address
    +         p.send(queue, message);
    --- End diff --
   
    How so? I do need at least one send when dealing with anonymous producer. That is the point of the test, to send a message on the broker, that is the point where any auto-creation happens.


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] activemq-artemis pull request #2084: ARTEMIS-1859 Adding testAnonymousProduc...

asfgit
In reply to this post by asfgit
Github user tabish121 commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2084#discussion_r187643834
 
    --- Diff: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageProducerTest.java ---
    @@ -70,10 +70,31 @@ public void testAnonymousProducer() throws Exception {
        }
     
        @Test(timeout = 30000)
    -   public void testAnonymousProducerWithAutoCreation() throws Exception {
    -      Connection connection = createConnection();
    +   public void testAnonymousProducerWithQueueAutoCreation() throws Exception {
    +      try (Connection connection = createConnection()) {
    +         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
    +         Queue queue = session.createQueue(UUID.randomUUID().toString());
    +         MessageProducer p = session.createProducer(null);
     
    -      try {
    +         TextMessage message = session.createTextMessage();
    +         message.setText("hello");
    +         // this will auto-create the address
    +         p.send(queue, message);
    --- End diff --
   
    I believe it is the second send you don't need, the first on create the address which result in a MULTICAST address being created which sets up the scene for the create consumer to fail because the consumer is creating a JMS Queue and will get clobbered because that address is already MULTICAST or something.  


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] activemq-artemis pull request #2084: ARTEMIS-1859 Adding testAnonymousProduc...

asfgit
In reply to this post by asfgit
Github user jdanekrh commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2084#discussion_r187648801
 
    --- Diff: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageProducerTest.java ---
    @@ -70,10 +70,31 @@ public void testAnonymousProducer() throws Exception {
        }
     
        @Test(timeout = 30000)
    -   public void testAnonymousProducerWithAutoCreation() throws Exception {
    -      Connection connection = createConnection();
    +   public void testAnonymousProducerWithQueueAutoCreation() throws Exception {
    +      try (Connection connection = createConnection()) {
    +         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
    +         Queue queue = session.createQueue(UUID.randomUUID().toString());
    +         MessageProducer p = session.createProducer(null);
     
    -      try {
    +         TextMessage message = session.createTextMessage();
    +         message.setText("hello");
    +         // this will auto-create the address
    +         p.send(queue, message);
    --- End diff --
   
    Thanks, I get it now. Ok, I don't need it.


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] activemq-artemis pull request #2084: ARTEMIS-1859 Adding testAnonymousProduc...

asfgit
In reply to this post by asfgit
Github user gemmellr commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2084#discussion_r187650767
 
    --- Diff: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageProducerTest.java ---
    @@ -70,10 +70,31 @@ public void testAnonymousProducer() throws Exception {
        }
     
        @Test(timeout = 30000)
    -   public void testAnonymousProducerWithAutoCreation() throws Exception {
    -      Connection connection = createConnection();
    +   public void testAnonymousProducerWithQueueAutoCreation() throws Exception {
    +      try (Connection connection = createConnection()) {
    +         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
    +         Queue queue = session.createQueue(UUID.randomUUID().toString());
    +         MessageProducer p = session.createProducer(null);
     
    -      try {
    +         TextMessage message = session.createTextMessage();
    +         message.setText("hello");
    +         // this will auto-create the address
    +         p.send(queue, message);
    --- End diff --
   
    Yeah, thats what I meant to say, the second send.


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] activemq-artemis issue #2084: ARTEMIS-1859 Adding testAnonymousProducerWithQ...

asfgit
In reply to this post by asfgit
Github user jdanekrh commented on the issue:

    https://github.com/apache/activemq-artemis/pull/2084
 
    trying to add commit


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] activemq-artemis issue #2084: ARTEMIS-1859 Adding testAnonymousProducerWithQ...

asfgit
In reply to this post by asfgit
Github user jbertram commented on the issue:

    https://github.com/apache/activemq-artemis/pull/2084
 
    I've pulled this test into #2464 along with the fix (including removing the 2nd `send`). This PR can be closed.


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] activemq-artemis pull request #2084: ARTEMIS-1859 Adding testAnonymousProduc...

asfgit
In reply to this post by asfgit
Github user jdanekrh closed the pull request at:

    https://github.com/apache/activemq-artemis/pull/2084


---