This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I am new to using MQ, but need to do the seemingly simplest task. I need a Java client program to make a MQ connection and send a string over that connection to a server.
Here is what I know.
- I have installed the MQ Client v5.3 on Windows XP. - I have received a .tab file from the server group. - I have configured the environment properly, enabling me to use amqsputc to successfully send a message to the server.
Now comes the rub. I have been trying to use the sample MSender.java to write that same message from a Java program, but can't get to first base. If I try the following:
Hi, Happy to help but have to ask the obvious questions first.. 2059 normally means that the queue manager is not available.. can I assume that you have a) Created the queue manager using the crtmqm command (or whatever the command is these days) and b) started the queue manager (strmqm).
There also needs to be an mq listener running which I think was the runmqlsr -m <Qmgr> -p <port number> -t tcp (Im assuming your using TCP) command.
Check these things and if your still having probs write back.
Wait up... ignore last post (just read your post properly).. Have you set the following MQEnvironment properties correctly before trying the MQQueueManager call....
MQEnvironment.hostname = "my.mqsvr.com"; // host to connect to MQEnvironment.port = 1414; // port to connect to. // If I don't set this, // it defaults to 1414 // (the default WebSphere MQ port) MQEnvironment.channel = "channel.name"; // the CASE-SENSITIVE // name of the // SVR CONN channel on // the queue manager MQQueueManager qMgr = new MQQueueManager("MYQMGR");
Joined: Jun 16, 2006
Also if you notice in the applet code below the properties have to be stored in the MQEnvironment object. In fact the code below should provide you with all you need to connect to the server. Good luck