Author |
Message
|
alfia_786 |
Posted: Wed Nov 14, 2007 8:54 am Post subject: (imp) message not received |
|
|
Novice
Joined: 13 Nov 2007 Posts: 12
|
Hi,
Plz somebody help me
I am trying a very simple send and receive program which is not working,it gives a 2033 reason code and if i try to write a program to just print the contents of the reply queue it does not have the message that was sent recently.If I dont get the message that I am sending ,does that mean the message was not sent,but the put method is called and no exceptions are thrown..plz help..here is my code:
this is for sending :
--------------------------------------------------------------
qMgr = new MQQueueManager(qManager);
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT
| MQC.MQOO_INQUIRE ;
MQQueue sendQueue = qMgr.accessQueue(queuename, openOptions);
MQPutMessageOptions pmo = new MQPutMessageOptions();
MQMessage regrenewal = new MQMessage();
regrenewal.format = MQC.MQFMT_STRING;
regrenewal.replyToQueueName = replyq;
regrenewal.writeString("sending data");
sendQueue.put(regrenewal, pmo);
out.println("msg put the message id is"+regrenewal.messageId);
qMgr.commit();
sendQueue.close();
----------------------------------------------------------------------
this is for receiving
-----------------------------------------------------------------------
qMgr = new MQQueueManager(qManager);
int openOptions = MQC.MQOO_OUTPUT
| // for put access
MQC.MQOO_INQUIRE
| // check q depth
MQC.MQOO_INPUT_AS_Q_DEF
| // for get access
MQC.MQOO_FAIL_IF_QUIESCING
|
MQC.MQOO_BROWSE;
MQQueue outQ = qMgr.accessQueue(replyq,openOptions);
int curDepth = outQ.getCurrentDepth();
int maxLength = outQ.getMaximumMessageLength();
out.println("Current depth: " + curDepth);
MQMessage myMessage = new MQMessage();
myMessage.format = MQC.MQFMT_STRING;
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.options = MQC.MQGMO_BROWSE_FIRST;
outQ.get(myMessage, gmo);
out.println(" about to read msg");
tring msgText = myMessage.readString(myMessage.getMessageLength());
out.println("The message is: " + msgText);
qMgr.commit();
outQ.close();
qMgr.disconnect(); |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Nov 14, 2007 9:01 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Don't bother with the qdepth.
Check the queue using something else after the PUT, and before you start the receiver. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
alfia_786 |
Posted: Wed Nov 14, 2007 9:08 am Post subject: |
|
|
Novice
Joined: 13 Nov 2007 Posts: 12
|
what shoulld i check it with?I tried using the methods/fields in MQQueue class and also MQputMessageOptions like knownDestCount etc but nothing works |
|
Back to top |
|
 |
Vitor |
Posted: Wed Nov 14, 2007 9:10 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
alfia_786 wrote: |
what shoulld i check it with? |
amqsget - to determine that the message has really been put & the problem's the receiver not the sender. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Nov 14, 2007 9:14 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
amqsget
amqsbcg
mqexplorer
runmqsc
....
.... _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
alfia_786 |
Posted: Wed Nov 14, 2007 9:46 am Post subject: runmqsc command |
|
|
Novice
Joined: 13 Nov 2007 Posts: 12
|
This might sound stupid but I have never worked on Websphere before,so please help me:
The mQ client is installed on the linux server and i thinks its under the directory /opt/mqm ,so should i go to this directory to run the runmqsc or mqexplorer or amqsget
amqsbcg commands |
|
Back to top |
|
 |
Vitor |
Posted: Wed Nov 14, 2007 12:12 pm Post subject: Re: runmqsc command |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
alfia_786 wrote: |
This might sound stupid but I have never worked on Websphere before,so please help me: |
I urge you to seek professional training. WMQ is not a straightforward thing, and this forum is not an ideal training resource.
Explorer is the GUI, use it if you have it
runmqsc is the admin interface, the display command is what you want
amqsget/amqsbcg are sample programs, probably in /opt/mqm/samp/bin _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|