[
https://issues.apache.org/jira/browse/ARTEMIS-1921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17837364#comment-17837364
]
Justin Bertram commented on ARTEMIS-1921:
-----------------------------------------
Your attachment uses
{{org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory#setClientID}}.
This is a _convenience method_ provided by the Core JMS client and is **not**
part of the
[JMS|https://docs.oracle.com/javaee/7/api/javax/jms/ConnectionFactory.html] or
[Jakarta
Messaging|https://jakarta.ee/specifications/messaging/3.0/apidocs/jakarta/jms/connectionfactory]
API. A similar method is provided by the [Qpid JMS
client|setsetCsetClientIdsetClientIdsetClientIDsetClientIdsetClientID].
I don't see a similar method on the [FuseSource StompJMS
client|https://github.com/fusesource/stompjms/blob/master/stompjms-client/src/main/java/org/fusesource/stomp/jms/StompJmsConnectionFactory.java]
so I'm not sure exactly what you're using there. That said, Artemis supports
setting the {{client-id}} header on the {{CONNECT}} frame.
In the instances with Qpid and STOMP the client ID is present _at the time the
connection is made_ which is why it is then available on the
{{RemotingConnection}} passed to the security manager. I can update the broker
so that the same happens for the Core JMS client, but as noted previously, this
will rely on the fact that the client ID can be set on the
{{ConnectionFactory}} implementation which is not part of the specification.
The danger here is that if you ever moved to a different JMS broker this code
would break.
> Setting clientID in artemis-jms-client has no effect
> ----------------------------------------------------
>
> Key: ARTEMIS-1921
> URL: https://issues.apache.org/jira/browse/ARTEMIS-1921
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Components: Broker
> Affects Versions: 2.6.1
> Reporter: Johan Stenberg
> Priority: Major
> Attachments: Artemis1921_CoreJmsClient_SetClientId_Test.java
>
>
> As opposite to Qpid JMS Client over AMPQ1.0 or FuseSource StompJMS client
> over STOMP, a clientID set on the JMS ConnectionFactory or the Connection in
> the Artemis JMS Client is not available on the broker via
> RemotingConnection#getClientID().
--
This message was sent by Atlassian Jira
(v8.20.10#820010)