[
https://issues.apache.org/jira/browse/ARTEMIS-728?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15484244#comment-15484244
]
ASF GitHub Bot commented on ARTEMIS-728:
----------------------------------------
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.
> Broker doesn't support unique jms client-id (qpid-jms client)
> -------------------------------------------------------------
>
> Key: ARTEMIS-728
> URL: https://issues.apache.org/jira/browse/ARTEMIS-728
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Components: AMQP
> Affects Versions: 1.3.0
> Reporter: Howard Gao
> Assignee: Howard Gao
> Fix For: 1.4.0
>
>
> Using qpid-jms client to set a client-id that has already set on another
> connection does't get expected InvalidClientIDException exception.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)