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 » How to specify the MCA on my qconnfactory

Post new topic  Reply to topic
 How to specify the MCA on my qconnfactory « View previous topic :: View next topic » 
Author Message
jhidalgo
PostPosted: Mon Dec 22, 2008 2:39 pm    Post subject: How to specify the MCA on my qconnfactory Reply with quote

Disciple

Joined: 26 Mar 2008
Posts: 161

I am trying to code a standalone application that will connect to a number of qmgrs with different settings (usernames, channel conns, etc..). So changing the MQEnvironment will not work but I haven't been able to find the proper class for this task.

Most of classes I've found use the username running the application, and since this is a standalone application I don't think JMS is the best option.

Anyone has any recommendation on how to connect to multiple qmgrs or what class to use that lets me specify the username as part of the params ?

Thanks.
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Mon Dec 22, 2008 3:57 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

Don't double post. The answer is in the other posting.

Regards,
Roger Lacroix
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
fjb_saper
PostPosted: Mon Dec 22, 2008 9:51 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

And quite easy to do in JMS. Lookup the qcf.createConnection(username,password) method.
Usually I pass a null password as it is not being checked unless you have a security exit. (Thanks Roger...)
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
jhidalgo
PostPosted: Tue Dec 23, 2008 6:35 am    Post subject: Reply with quote

Disciple

Joined: 26 Mar 2008
Posts: 161

RogerLacroix wrote:
Don't double post. The answer is in the other posting.

Regards,
Roger Lacroix


Do you mind giving me the link ?
Back to top
View user's profile Send private message
jhidalgo
PostPosted: Tue Dec 23, 2008 8:50 am    Post subject: Reply with quote

Disciple

Joined: 26 Mar 2008
Posts: 161

I got it nailed, in case anybody else needs it:

Code:

     try{
         Hashtable<String,Object> hash= new Hashtable<String,Object>(); //Obj since we need strings and ints
         hash.put(MQConstants.USER_ID_PROPERTY, "ultrasecretusername");
         hash.put(MQConstants.PORT_PROPERTY,1415); //must be integer
         hash.put(MQConstants.HOST_NAME_PROPERTY,"192.168.1.1");  //can be the ip
         hash.put(MQConstants.CHANNEL_PROPERTY,"SYSTEM.ADMIN.SVRCONN");
         MQQueueManager qmgr= new MQQueueManager("QMANAGER_PROD", hash);
         System.out.println(qmgr.getDescription());
      }catch(MQException mqe){
         System.err.println("MQ Exception: "+mqe.getMessage());
      }

Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Dec 23, 2008 8:54 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

jhidalgo wrote:
I got it nailed, in case anybody else needs it:

Code:

     try{
         Hashtable<String,Object> hash= new Hashtable<String,Object>(); //Obj since we need strings and ints
         hash.put(MQConstants.USER_ID_PROPERTY, "ultrasecretusername");
         hash.put(MQConstants.PORT_PROPERTY,1415); //must be integer
         hash.put(MQConstants.HOST_NAME_PROPERTY,"192.168.1.1");  //can be the ip
         hash.put(MQConstants.CHANNEL_PROPERTY,"SYSTEM.ADMIN.SVRCONN");
         MQQueueManager qmgr= new MQQueueManager("QMANAGER_PROD", hash);
         System.out.println(qmgr.getDescription());
      }catch(MQException mqe){
         System.err.println("MQ Exception: "+mqe.getMessage());
      }



Really relates to the thread with java base and c.

Like I said for JMS investigate the createConnection method. Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » How to specify the MCA on my qconnfactory
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.