zhfeng commented on issue #3951:
URL: https://github.com/apache/camel-quarkus/issues/3951#issuecomment-1203679009

   `testJmsTopic` is failing with
   ```
   2022-08-03 12:14:01,792 ERROR 
[org.apa.cam.com.jms.DefaultJmsMessageListenerContainer] (Camel (camel-1) 
thread #15 - JmsConsumer[test]) Could not refresh JMS Connection for 
destination 'test' - retrying using FixedBackOff{interval=5000, 
currentAttempts=1, maxAttempts=unlimited}. Cause: setClientID can only be 
called directly after the connection is created
   ```
   The test route look like
   ```java
       // Topic routes
       
fromF("%s:topic:test?clientId=123&durableSubscriptionName=camel-quarkus", 
componentScheme)
               .to("mock:topicResultA");
   
       
fromF("%s:topic:test?clientId=456&durableSubscriptionName=camel-quarkus", 
componentScheme)
               .to("mock:topicResultB");
   ```
   
   It seems `setClientId` is invokded on the `reused` connection from the pool. 
I just check the [JMS 
spec](https://docs.oracle.com/javaee/7/api/javax/jms/Connection.html?is-external=true#setClientID-java.lang.String-)
 and find
   >If a client sets the client identifier explicitly, it must do so 
immediately after it creates the connection and before any other action on the 
connection is taken. After this point, setting the client identifier is a 
programming error that should throw an IllegalStateException.
   
   So when using the JMS pooling, we can not use `clientId`. Is there anything 
I missed or misunderstand the spec? @jamesnetherton 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to