|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
mqrc 2097 |
« View previous topic :: View next topic » |
Author |
Message
|
marco |
Posted: Wed Aug 31, 2005 1:30 am Post subject: mqrc 2097 |
|
|
Apprentice
Joined: 16 Feb 2004 Posts: 46
|
Hi,
can anyone please tell me what I'm doing wrong here ...
it seems like I'm in need of a "Cold Reviewer"
Tx
import com.ibm.mq.*;
import java.io.IOException;
import java.io.PrintStream;
public class GetAndPut
{
public GetAndPut()
{
}
public static void main(String args[])
{
GetAndPut getAndPut1 = new GetAndPut();
try
{
MQQueueManager qmgr = new MQQueueManager("QM.TEST");
int getqOpenOptions = MQC.MQOO_INPUT_AS_Q_DEF+MQC.MQOO_SAVE_ALL_CONTEXT+MQC.MQOO_FAIL_IF_QUIESCING;
MQQueue getQueue = qmgr.accessQueue("Q1", getqOpenOptions);
int putqOpenOptions = MQC.MQOO_OUTPUT+MQC.MQOO_FAIL_IF_QUIESCING+MQC.MQOO_PASS_ALL_CONTEXT;
MQQueue putQueue = qmgr.accessQueue("Q3", putqOpenOptions);
MQMessage msg = new MQMessage();
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.options += MQC.MQGMO_FAIL_IF_QUIESCING+ MQC.MQGMO_NO_SYNCPOINT+MQC.MQGMO_WAIT;
gmo.waitInterval = 30000;
System.out.println("waiting for a message...");
getQueue.get(msg, gmo);
System.out.println("got the message");
MQPutMessageOptions pmo = new MQPutMessageOptions();
pmo.options = MQC.MQPMO_NO_SYNCPOINT+MQC.MQPMO_FAIL_IF_QUIESCING+MQC.MQPMO_PASS_ALL_CONTEXT;
putQueue.put(msg, pmo);
System.out.println("the message was put");
getQueue.close();
putQueue.close();
qmgr.disconnect();
}
catch(MQException ex)
{
System.out.println(String.valueOf(String.valueOf((new StringBuffer("An MQSeries error occurred : Completion code ")).append(ex.completionCode).append(" Reason code ").append(ex.reasonCode))));
ex.printStackTrace();
}
}
} |
|
Back to top |
|
 |
Mr Butcher |
Posted: Wed Aug 31, 2005 2:04 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
the pmo has a field called "context" which is of type "queue handle" if you use the pass_all_context then this field must contain the queue handle of the input queue (at least on z/OS where i used that in the past).
i am no java expert, but i do not find anything similiar in your code, and i dont know how to do that in java, but maybe this is the problem...
check pmo in application programmers reference. _________________ Regards, Butcher |
|
Back to top |
|
 |
mqmhr |
Posted: Wed Aug 31, 2005 2:12 am Post subject: |
|
|
Centurion
Joined: 28 Dec 2004 Posts: 105
|
MQPutMessageOptions class has a field contextReference that is of type MQQueue. The queue handle should be set as value of this field. |
|
Back to top |
|
 |
marco |
Posted: Wed Aug 31, 2005 3:29 am Post subject: |
|
|
Apprentice
Joined: 16 Feb 2004 Posts: 46
|
Tx
this was indeed the solution :
pmo.contextReference = getQueue; |
|
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
|
|
|
|