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 2016/09/12 08:29:29 UTC

[GitHub] activemq-artemis pull request #769: ARTEMIS-728 Broker doesn't support uniqu...

GitHub user gaohoward opened a pull request:

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

    ARTEMIS-728 Broker doesn't support unique jms client-id (qpid-jms client)

    

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

    $ git pull https://github.com/gaohoward/activemq-artemis master-tck

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

    https://github.com/apache/activemq-artemis/pull/769.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 #769
    
----
commit 69cb9e0a2263d3d766bd664894c553c2bf99414e
Author: Howard Gao <ho...@gmail.com>
Date:   2016-09-12T08:27:11Z

    ARTEMIS-728 Broker doesn't support unique jms client-id (qpid-jms client)

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] activemq-artemis pull request #769: ARTEMIS-728 Broker doesn't support uniqu...

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/769#discussion_r78381566
  
    --- Diff: artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/plug/ActiveMQProtonConnectionCallback.java ---
    @@ -85,7 +105,42 @@ public boolean isSupportsAnonymous() {
        }
     
        @Override
    +   public void init() throws Exception {
    +      //This internal core session is used to represent the connection
    +      //in core server. It is used to identify unique clientIDs.
    +      //Note the Qpid-JMS client does create a initial session
    +      //for each connection. However is comes in as a Begin
    +      //After Open. This makes it unusable for this purpose
    +      //as we need to decide the uniqueness in response to
    +      //Open, and the checking Uniqueness and adding the unique
    +      //client-id to server need to be atomic.
    +      if (internalSession == null) {
    +         SASLResult saslResult = amqpConnection.getSASLResult();
    +         String user = null;
    +         String passcode = null;
    +         if (saslResult != null) {
    +            user = saslResult.getUser();
    +            if (saslResult instanceof PlainSASLResult) {
    +               passcode = ((PlainSASLResult) saslResult).getPassword();
    +            }
    +         }
    +         internalSession = manager.getServer().createSession(createInternalSessionName(), user, passcode, ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE, protonConnectionDelegate, // RemotingConnection remotingConnection,
    --- End diff --
    
    @clebertsuconic yes that seems suck. I indeed thought of a refactor but it may affects artemis jms client and we may consider doing it in a separate Jira.
    btw I'll be on PTO/holiday for the rest of the week. I'll be back on Monday.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] activemq-artemis pull request #769: ARTEMIS-728 Broker doesn't support uniqu...

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/769#discussion_r78380441
  
    --- Diff: artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/plug/ActiveMQProtonConnectionCallback.java ---
    @@ -85,7 +105,42 @@ public boolean isSupportsAnonymous() {
        }
     
        @Override
    +   public void init() throws Exception {
    +      //This internal core session is used to represent the connection
    +      //in core server. It is used to identify unique clientIDs.
    +      //Note the Qpid-JMS client does create a initial session
    +      //for each connection. However is comes in as a Begin
    +      //After Open. This makes it unusable for this purpose
    +      //as we need to decide the uniqueness in response to
    +      //Open, and the checking Uniqueness and adding the unique
    +      //client-id to server need to be atomic.
    +      if (internalSession == null) {
    +         SASLResult saslResult = amqpConnection.getSASLResult();
    +         String user = null;
    +         String passcode = null;
    +         if (saslResult != null) {
    +            user = saslResult.getUser();
    +            if (saslResult instanceof PlainSASLResult) {
    +               passcode = ((PlainSASLResult) saslResult).getPassword();
    +            }
    +         }
    +         internalSession = manager.getServer().createSession(createInternalSessionName(), user, passcode, ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE, protonConnectionDelegate, // RemotingConnection remotingConnection,
    --- End diff --
    
    I would rather refactor ActiveMQServer to handle this instead of creating an internalSession. It gets over-copmlicated for something this simple.
    
    
    We can talk offline on how we would do such refactoring.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] activemq-artemis pull request #769: ARTEMIS-728 Broker doesn't support uniqu...

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

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


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---