|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to specify the MCA on my qconnfactory |
« View previous topic :: View next topic » |
Author |
Message
|
jhidalgo |
Posted: Mon Dec 22, 2008 2:39 pm Post subject: How to specify the MCA on my qconnfactory |
|
|
 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 |
|
 |
RogerLacroix |
Posted: Mon Dec 22, 2008 3:57 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Dec 22, 2008 9:51 pm Post subject: |
|
|
 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 |
|
 |
jhidalgo |
Posted: Tue Dec 23, 2008 6:35 am Post subject: |
|
|
 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 |
|
 |
jhidalgo |
Posted: Tue Dec 23, 2008 8:50 am Post subject: |
|
|
 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 |
|
 |
fjb_saper |
Posted: Tue Dec 23, 2008 8:54 am Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
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
|
|
|
|