You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by mtaylor <gi...@git.apache.org> on 2018/08/13 14:19:42 UTC

[GitHub] activemq-artemis pull request #2246: ARTEMIS-2024 Enable SharedClientID on C...

GitHub user mtaylor opened a pull request:

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

    ARTEMIS-2024 Enable SharedClientID on ConnectionFactory

    

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

    $ git pull https://github.com/mtaylor/activemq-artemis ARTEMIS-2024

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

    https://github.com/apache/activemq-artemis/pull/2246.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 #2246
    
----
commit 3d7e60a6b9408bc2985e84a2370429dd024b4560
Author: Martyn Taylor <mt...@...>
Date:   2018-08-10T11:25:14Z

    ARTEMIS-2024 Enable SharedClientID on ConnectionFactory

----


---

[GitHub] activemq-artemis pull request #2246: ARTEMIS-2024 Enable SharedClientID on C...

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/2246#discussion_r209658818
  
    --- Diff: artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnection.java ---
    @@ -673,12 +673,16 @@ protected final void checkClosed() throws JMSException {
           }
        }
     
    -   public void authorize() throws JMSException {
    +   public void authorize(boolean validateClientId) throws JMSException {
    --- End diff --
    
    @michaelandrepearce that's internal API though



---

[GitHub] activemq-artemis issue #2246: ARTEMIS-2024 Enable SharedClientID on Connecti...

Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on the issue:

    https://github.com/apache/activemq-artemis/pull/2246
  
    @jmesnil TBH: I thinks it's dumb to use clientID on a standalone CF.


---

[GitHub] activemq-artemis pull request #2246: ARTEMIS-2024 Enable SharedClientID on C...

Posted by mtaylor <gi...@git.apache.org>.
Github user mtaylor commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2246#discussion_r209671517
  
    --- Diff: artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnection.java ---
    @@ -673,12 +673,16 @@ protected final void checkClosed() throws JMSException {
           }
        }
     
    -   public void authorize() throws JMSException {
    +   public void authorize(boolean validateClientId) throws JMSException {
    --- End diff --
    
    The method was public I will add it back.


---

[GitHub] activemq-artemis pull request #2246: ARTEMIS-2024 Enable SharedClientID on C...

Posted by michaelandrepearce <gi...@git.apache.org>.
Github user michaelandrepearce commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2246#discussion_r209658044
  
    --- Diff: artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnection.java ---
    @@ -673,12 +673,16 @@ protected final void checkClosed() throws JMSException {
           }
        }
     
    -   public void authorize() throws JMSException {
    +   public void authorize(boolean validateClientId) throws JMSException {
    --- End diff --
    
    public interface change in client code, should probably keep the existing method for people who may have coded against it.


---

[GitHub] activemq-artemis pull request #2246: ARTEMIS-2024 Enable SharedClientID on C...

Posted by mtaylor <gi...@git.apache.org>.
Github user mtaylor commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2246#discussion_r209671702
  
    --- Diff: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ConnectionTest.java ---
    @@ -131,6 +131,27 @@ public void testTwoConnectionsSameIDThroughCF() throws Exception {
           session2.close();
        }
     
    +   @Test
    +   public void testTwoConnectionsSameIDThroughCFWithShareClientIDEnabeld() throws Exception {
    +      ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616?clientID=myid;enableSharedClientID=true");
    +
    +      conn = connectionFactory.createConnection();
    +      try {
    +         conn2 = connectionFactory.createConnection();
    +      } catch (InvalidClientIDException expected) {
    +         Assert.fail("Should allow sharing of client IDs among the same CF");
    +      }
    +
    +      Session session1 = conn.createSession();
    +      Session session2 = conn.createSession();
    --- End diff --
    
    Yes.  Copy and paste error ;).  Will fix.


---

[GitHub] activemq-artemis issue #2246: ARTEMIS-2024 Enable SharedClientID on Connecti...

Posted by mtaylor <gi...@git.apache.org>.
Github user mtaylor commented on the issue:

    https://github.com/apache/activemq-artemis/pull/2246
  
    The spec also says that the preferred way to set the client id is via the CF.  I think we just have to chalk this one up as the spec being ambiguous.  I can see how people may interpret one way or the other.


---

[GitHub] activemq-artemis pull request #2246: ARTEMIS-2024 Enable SharedClientID on C...

Posted by michaelandrepearce <gi...@git.apache.org>.
Github user michaelandrepearce commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2246#discussion_r209658786
  
    --- Diff: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ConnectionTest.java ---
    @@ -131,6 +131,27 @@ public void testTwoConnectionsSameIDThroughCF() throws Exception {
           session2.close();
        }
     
    +   @Test
    +   public void testTwoConnectionsSameIDThroughCFWithShareClientIDEnabeld() throws Exception {
    +      ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616?clientID=myid;enableSharedClientID=true");
    +
    +      conn = connectionFactory.createConnection();
    +      try {
    +         conn2 = connectionFactory.createConnection();
    +      } catch (InvalidClientIDException expected) {
    +         Assert.fail("Should allow sharing of client IDs among the same CF");
    +      }
    +
    +      Session session1 = conn.createSession();
    +      Session session2 = conn.createSession();
    --- End diff --
    
    Probably should test conn2 as well here?


---

[GitHub] activemq-artemis pull request #2246: ARTEMIS-2024 Enable SharedClientID on C...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---

[GitHub] activemq-artemis issue #2246: ARTEMIS-2024 Enable SharedClientID on Connecti...

Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on the issue:

    https://github.com/apache/activemq-artemis/pull/2246
  
    @michaelandrepearce on the connection.. yeah! On the connectionFactory. .that's a broker-specific extension. you set it on the CF as an utility for the user.
    
    That's just that! An utility. Setting it on the CF or on the connection it should have the same effect.


---

[GitHub] activemq-artemis issue #2246: ARTEMIS-2024 Enable SharedClientID on Connecti...

Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on the issue:

    https://github.com/apache/activemq-artemis/pull/2246
  
    failed test:
    Failed tests: 
      ConnectionFactoryPropertiesTest.testCompareConnectionFactoryAndResourceAdapterProperties:86->compare:97->Assert.fail:88 in ActiveMQ Connection Factory only: [enableSharedClientID]
    in ActiveMQ Resource Adapter only: []


---

[GitHub] activemq-artemis issue #2246: ARTEMIS-2024 Enable SharedClientID on Connecti...

Posted by michaelandrepearce <gi...@git.apache.org>.
Github user michaelandrepearce commented on the issue:

    https://github.com/apache/activemq-artemis/pull/2246
  
    You have to set it for non shared durable subscriber by Jms spec.


---