|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
SOLUTION/BUG: MQQueueConnectionFactory client id |
« View previous topic :: View next topic » |
Author |
Message
|
kolthorr |
Posted: Mon Jan 24, 2005 6:39 am Post subject: SOLUTION/BUG: MQQueueConnectionFactory client id |
|
|
Apprentice
Joined: 09 Mar 2002 Posts: 31
|
Hi all,
Just had a little problem with MQ & JMS. We wanted to set a user id from a java application. Wonderful IDEs these days popup a list of methods on an object - so naturally we did something like:
Code: |
MQQueueConnectionFactory fact = new MQQueueConnectionFactory();
fact.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
fact.setQueueManager(QMGRNAME);
fact.setHostName(HOSTNAME);
fact.setChannel(CHANNEL);
fact.setPort(1234);
fact.setClientId("foo");
|
BUT - the userid comes through to MQ as blank - so our security exit was blocking the connection. All the other fields work as expected, as in, the values are set.
Turns out it needs the MQEnvironment 'userid' value set:
Code: |
MQEnvironment.userID = "foo";
|
and then it works. I guess I wonder what that 'clientId' field on the QueueConnectionFactory is, and what does it do?
Cheers,
Andrew |
|
Back to top |
|
 |
vennela |
Posted: Mon Jan 24, 2005 11:58 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
What you said doesn't make sense to me. Because you are mixing JMS with Base MQ java.
How did you set the userId using MQEnvironment? |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Jan 24, 2005 12:43 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Set the userid :
TopicConnection tc = tcf.createTopicConnection(userid, passwd);
Enjoy  |
|
Back to top |
|
 |
kolthorr |
Posted: Tue Jan 25, 2005 2:00 am Post subject: |
|
|
Apprentice
Joined: 09 Mar 2002 Posts: 31
|
Thanks all for the replies. Vennela - you're right, it did feel a bit wierd having to use BaseMQ with JMS stuff (our app has access to both classes). But it seemed to work, just using the MQEnvironment class.
Also fjb - thanks for the tip. I'd totally missed the overloaded method - d'oh! Works a treat now.
Cheers,
Andrew |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|