|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Prolem with putting messages to a queue alias using Java |
« View previous topic :: View next topic » |
Author |
Message
|
hilltops |
Posted: Mon Sep 04, 2006 7:34 am Post subject: Prolem with putting messages to a queue alias using Java |
|
|
Centurion
Joined: 01 Mar 2006 Posts: 112
|
I get the RC 2082 when i attempt to put a messge from a java application on a queue alias that targets a another cluster queue alias on a different queue manager; In fact my setup is as follows;
App - QueueManagerA ->QueueManagerB - QueuemanagerC ->
QueueManagerD ->QueueManagerE
QueueManagerA and QueuemanagerB are in the same cluster, CLUSA; B and C are CLUSB; C and D in CLUSC; D and E in CLUSD . There's a qalias on A that targets a clustered qalias on B that targets a cluster qalias on C that targets a clustered qalias on D that targets a qlocal on E.
When I use the sample application to put a message on the qalias on A it works quite well. But when I use a sample java code, I get 2083 return code. The java code is below;
Any Ideas?
// Include the WebSphere MQ classes for Java package
import com.ibm.mq.*;
public class MQSample2
{
// define the name of your host to connect to
private String hostname = "hostname";
private String qManager = "queuemanager";
private String channel = "TEST.SVRCONN";
private int port = 15450;
private String reqQName = "GB_TED.GB_TED.HK_DTX.REQ.001";
private String resQName = "GB_TED.HK_DTX.GB_TED.RSP.001";
//
private MQQueueManager qMgr;
private MQQueue reqQueue;
private MQQueue resQueue;
public MQSample2()
{
try{
MQEnvironment.hostname = hostname;
MQEnvironment.channel = channel;
MQEnvironment.port = port;
//Set TCP/IP or server Connection
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES);
// Create a connection to the queue manager
qMgr = new MQQueueManager(qManager);
// Set up the options on the queue we wish to open...
// Note. All WebSphere MQ Options are prefixed with MQC in Java.
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT ;
// Now specify the queue that we wish to open, and the open options...
reqQueue = qMgr.accessQueue(reqQName, openOptions);
MQMessage myMessage = new MQMessage();
myMessage.writeUTF("Testing");
MQPutMessageOptions pmo = new MQPutMessageOptions();
reqQueue.put(myMessage,pmo);
qMgr.disconnect();
}
catch(Exception e){
}
}
public static void main(String[] args)
{
MQSample2 mq = new MQSample2();
}
} |
|
Back to top |
|
 |
hilltops |
Posted: Mon Sep 04, 2006 7:38 am Post subject: |
|
|
Centurion
Joined: 01 Mar 2006 Posts: 112
|
The sample application I meant is the amqsput that comes with MQ. |
|
Back to top |
|
 |
wschutz |
Posted: Mon Sep 04, 2006 7:42 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Code: |
nt openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT ; |
Why are you opening for INPUT? _________________ -wayne |
|
Back to top |
|
 |
hilltops |
Posted: Mon Sep 04, 2006 7:58 am Post subject: |
|
|
Centurion
Joined: 01 Mar 2006 Posts: 112
|
Thankx Wayne,
I change the code to only open for output and it worked. |
|
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
|
|
|
|