ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » SOLUTION/BUG: MQQueueConnectionFactory client id

Post new topic  Reply to topic
 SOLUTION/BUG: MQQueueConnectionFactory client id « View previous topic :: View next topic » 
Author Message
kolthorr
PostPosted: Mon Jan 24, 2005 6:39 am    Post subject: SOLUTION/BUG: MQQueueConnectionFactory client id Reply with quote

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
View user's profile Send private message
vennela
PostPosted: Mon Jan 24, 2005 11:58 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
fjb_saper
PostPosted: Mon Jan 24, 2005 12:43 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
kolthorr
PostPosted: Tue Jan 25, 2005 2:00 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » SOLUTION/BUG: MQQueueConnectionFactory client id
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.