Websphere MQ
Looking for a very good tutorial on how to configure and implement
Websphere MQ using embeded mqjms in WSAD 5.1.
Through admin console, I've created,
MQ QueueManager
Host: localhost
Port: 1414
Transport Type: Client
CCSID: 437
Here is some part of code that I am trying to use QueueManager and getting exception: MQJE001: An MQException occurred: Completion Code 2, Reason 2059.
String testMsg = "test-Successfull";
String hostname = "localhost";
String channel = "SYSTEM.DEF.SVRCONN";
int port = 1414;
System.out.println("setting up MQ");
if (hostname != null) {
System.out.println("hostname set to " + hostname);
MQEnvironment.hostname = hostname;
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES_CLIENT);
}
if (channel != null) {
System.out.println("channel set to " + channel);
MQEnvironment.channel = channel;
}
if (port != 0) {
System.out.println("port set to " + port);
MQEnvironment.port = port;
}
if (CCSID != 0) {
System.out.println("CCSID set to " + CCSID);
MQEnvironment.CCSID = CCSID;
}
System.out.println("MQmanager:");
MQQueueManager qMgr = new MQQueueManager(manager);
int openOptions = MQC.MQOO_OUTPUT;
System.out.println("MQmanager-access queue:");
MQQueue q = qMgr.accessQueue(queue, openOptions, null, null, null);
MQPutMessageOptions pmo = new MQPutMessageOptions();
pmo.options = MQC.MQPMO_NONE;
MQMessage mBuf = new MQMessage();
mBuf.clearMessage();
mBuf.correlationId = MQC.MQCI_NONE;
mBuf.messageId = MQC.MQMI_NONE;
mBuf.writeString(testMsg);
System.out.println("Put message to queue:");
q.put(mBuf, pmo);
System.out.println("About to close:");
q.close();
qMgr.disconnect();
Looks like I need to start jms server at 1414 but I am not sure how. Please provide sugestion.
Thanks