|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
regarding puttting and getting to a mq queue through java |
« View previous topic :: View next topic » |
Author |
Message
|
jefflowrey |
Posted: Thu Jul 08, 2004 3:18 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You need to provide the necessary connection properties in the MQEnvironment class.
Please consult the manual called "Using Java". There are simple examples in there, as well as detailed explanation. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
JT |
Posted: Thu Jul 08, 2004 5:56 am Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
|
Back to top |
|
 |
kirani |
Posted: Thu Jul 08, 2004 10:35 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Well, as folks said earlier, you need to use MQEnvironment class to specify your MQServer details. Here is an example (from Using Java manual),
Code: |
private String hostname = "your_hostname"; // define the name of your
// host to connect to
private String channel = "server_channel"; // define name of channel
// for client to use
// Note. assumes WebSphere MQ Server
// is listening on the default
// TCP/IP port of 1414
private String qManager = "your_Q_manager"; // define name of queue
// manager object to
// connect to.
// Set up WebSphere MQ environment
MQEnvironment.hostname = hostname; // Could have put the
// hostname & channel
MQEnvironment.channel = channel; // string directly here!
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, //Set TCP/IP or server
MQC.TRANSPORT_MQSERIES); //Connection
|
_________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
googledev |
Posted: Fri Jul 09, 2004 5:33 am Post subject: |
|
|
 Novice
Joined: 02 Jul 2004 Posts: 14
|
Channel name is mandatory. QueueManager belongs to a channel and you should have information abt Channel name to have a connection to the QueueManager.
FYI, using MQEnvironment is not thread safe, use HashTable approach, put all properties in HashTable and use the following constructor to build the connection.
mQueueManager = new MQQueueManager( qmgrName, mqProps ); |
|
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
|
|
|
|