Author |
Message
|
ashu |
Posted: Tue Feb 06, 2007 1:15 am Post subject: Removing messages from the QUEUE |
|
|
 Centurion
Joined: 11 Nov 2006 Posts: 132
|
Hi,
How do I remove messages from the LQ without actually using MQGET in any of its forms...
Thank you. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Feb 06, 2007 1:20 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
There's only one MQGET, it just takes different options.
Do you mean programatically or administratively? It's the only way within a program, but adminsitrators can use clear queue commands. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
ashu |
Posted: Tue Feb 06, 2007 1:37 am Post subject: |
|
|
 Centurion
Joined: 11 Nov 2006 Posts: 132
|
its Administratively...actually my sender is JMS complaint while reciver is not...so the receiver can't understand the message and cant MQGET it ...
I just wanted to refresh the queues..i couldn't remember how.... 
Last edited by ashu on Tue Feb 06, 2007 1:51 am; edited 1 time in total |
|
Back to top |
|
 |
Anirud |
Posted: Tue Feb 06, 2007 1:41 am Post subject: |
|
|
 Master
Joined: 12 Feb 2004 Posts: 285 Location: Vermont
|
Vitor wrote: |
adminsitrators can use clear queue commands. |
|
|
Back to top |
|
 |
Vitor |
Posted: Tue Feb 06, 2007 1:45 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
ashu wrote: |
its Administratively...actually my sender is JMS complaint while reciver is not...so the receiver can't understand the message and cant MQGET it ...
I just wanted to refresh the queues..i cant remember how....  |
Then the System Admin guide will be your new best friend.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Feb 06, 2007 2:09 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
ashu wrote: |
its Administratively...actually my sender is JMS complaint while reciver is not...so the receiver can't understand the message and cant MQGET it ...
|
Not strictly true btw - message content is irrelevant to the get. The receiver may not be able to interpret the message immediately, but even that's a fairly straigtforward job of removing (or interpreting) the RFH2 header JMS has added. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Feb 06, 2007 4:00 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
ashu wrote: |
its Administratively...actually my sender is JMS complaint while reciver is not...so the receiver can't understand the message and cant MQGET it ...
I just wanted to refresh the queues..i couldn't remember how....  |
Have your JMS sender use an URI for the Destination definition and make sure they add the targetClient part:
Code: |
session.createQueue("queue://MYQMGR/DESTINATIONQUEUE?targetClient=1"); |
This should allow your non JMS program to read the message without problems.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
ashu |
Posted: Tue Feb 06, 2007 4:15 am Post subject: |
|
|
 Centurion
Joined: 11 Nov 2006 Posts: 132
|
fjb_saper wrote: |
ashu wrote: |
its Administratively...actually my sender is JMS complaint while reciver is not...so the receiver can't understand the message and cant MQGET it ...
I just wanted to refresh the queues..i couldn't remember how....  |
Have your JMS sender use an URI for the Destination definition and make sure they add the targetClient part:
Code: |
session.createQueue("queue://MYQMGR/DESTINATIONQUEUE?targetClient=1"); |
This should allow your non JMS program to read the message without problems.
Enjoy  |
I would greatly appreciate it if you explain the code
thank you
regards
Ashu  |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Feb 06, 2007 4:20 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
It is all explained in the using Java manual (link documentation at the top of the page ...
This is the programmatic equivalent of the JNDI setting target client = MQ.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
ashu |
Posted: Tue Feb 06, 2007 4:23 am Post subject: |
|
|
 Centurion
Joined: 11 Nov 2006 Posts: 132
|
fjb_saper wrote: |
It is all explained in the using Java manual (link documentation at the top of the page ...
This is the programmatic equivalent of the JNDI setting target client = MQ.
Enjoy  |
Thank you for the pointer...
Regards
Ashu  |
|
Back to top |
|
 |
Vitor |
Posted: Tue Feb 06, 2007 4:24 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
ashu wrote: |
I would greatly appreciate it if you explain the code
|
There's a Java manual you might find an informative read but in summary JMS adds a header to it's messages which is used for various purposes described in the manual & which I don't plan to repeat here. This information is (obviously) added to the MQ message in the form of an RFH2 header. A JMS application reading the message will expect this header, a non-JMS will not.
You therefore have 2 options - code the non-JMS application to expect & process the extra header information or use the code supplied by fjb_saper to suppress the header.
Searching either this forum or the manual for 'targetclient' would have yielded much the same information, and you wouldn't have had the delay in receiving a response.
I also commend the Java manual to you if you want a more detailed explaination of the mapping between JMS and MQMD/MQRFH2 than the rather simplistic one I've given here. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
ashu |
Posted: Tue Feb 06, 2007 4:40 am Post subject: |
|
|
 Centurion
Joined: 11 Nov 2006 Posts: 132
|
Vitor
Greatly benefitted...thanks a lot
Regards
Ashu |
|
Back to top |
|
 |
|