[jira] [Comment Edited] (ARTEMIS-1921) Setting clientID in artemis-jms-client has no effect

2024-04-15 Thread Robbie Gemmell (Jira)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-1921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17837376#comment-17837376
 ] 

Robbie Gemmell edited comment on ARTEMIS-1921 at 4/15/24 5:19 PM:
--

The attached code tries _both_ the ConnectionFactory method that is impl-detail 
and not part of the API (though is in the vein of 'administratively configured' 
values the spec does speak to), as well as the Connection method that _is_ part 
of the spec. The latter is portable.


was (Author: gemmellr):
The attached code tries _both_ the ConnectionFactory method that is impl-detail 
and not part of the APUI (though is in the vein of 'administratively 
configured' values the spec does speak to), as well as the Connection method 
that _is_ part of the spec. The latter is portable.

> 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)


[jira] [Comment Edited] (ARTEMIS-1921) Setting clientID in artemis-jms-client has no effect

2024-04-15 Thread Justin Bertram (Jira)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-1921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17837364#comment-17837364
 ] 

Justin Bertram edited comment on ARTEMIS-1921 at 4/15/24 5:02 PM:
--

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.


was (Author: jbertram):
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)


[jira] [Comment Edited] (ARTEMIS-1921) Setting clientID in artemis-jms-client has no effect

2024-04-15 Thread Justin Bertram (Jira)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-1921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17837364#comment-17837364
 ] 

Justin Bertram edited comment on ARTEMIS-1921 at 4/15/24 5:03 PM:
--

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|https://github.com/apache/qpid-jms/blob/e0c40397ed7380c7009acc1d5dfa39de1687d588/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnectionFactory.java#L783].

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.


was (Author: jbertram):
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)