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 IndexGeneral Discussionregarding puttting and getting to a mq queue through java

Post new topicReply to topic
regarding puttting and getting to a mq queue through java View previous topic :: View next topic
Author Message
jefflowrey
PostPosted: Thu Jul 08, 2004 3:18 am Post subject: Reply with quote

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
View user's profile Send private message
JT
PostPosted: Thu Jul 08, 2004 5:56 am Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

IBM has also provided some JAVA/JMS sample programs: http://www.developer.ibm.com/tech/sampmq.html
Back to top
View user's profile Send private message
kirani
PostPosted: Thu Jul 08, 2004 10:35 pm Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
googledev
PostPosted: Fri Jul 09, 2004 5:33 am Post subject: Reply with quote

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

MQSeries.net Forum IndexGeneral Discussionregarding puttting and getting to a mq queue through java
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.