|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Selective read on a queue based on message content |
« View previous topic :: View next topic » |
Author |
Message
|
jarun111 |
Posted: Mon May 18, 2009 8:05 am Post subject: Selective read on a queue based on message content |
|
|
Acolyte
Joined: 19 Apr 2004 Posts: 70
|
Hi,
Is there a way to remove only messages that has some specific pattern on the message content. Message is a Text message and it does not use message header. Let me know.
Thanks |
|
Back to top |
|
 |
Vitor |
Posted: Mon May 18, 2009 8:59 am Post subject: Re: Selective read on a queue based on message content |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
jarun111 wrote: |
Message is a Text message and it does not use message header. |
If you want to do this with a tool (given where you've posted), one way would be to unload the queue to a file, clear the required messages from the file & reload the queue.
As you talk about a Text message, I theorise you have a Java perspective on the message. You could in theory write a small Java app that uses message selectors to selectivly read messages from the queue. Exact details from another poster who knows more about Java than I do!
Other methods are undoubtably possible. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
vol |
Posted: Mon May 18, 2009 10:40 pm Post subject: |
|
|
Acolyte
Joined: 01 Feb 2009 Posts: 69
|
Read up on msg properties in WMQ v7 |
|
Back to top |
|
 |
zpat |
Posted: Mon May 18, 2009 11:22 pm Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
You don't say if this is an application requirement or an admin task.
JMS selectors would be one way for applications (browsing and then get under browse cursor would be another), for admin support pac MO71 can unload or purpge messages with certain contents. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue May 19, 2009 4:44 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Once a message is on a queue, the only way to do anything based on the existing contents of the existing message is to browse it,inspect the contents, and then decide what to do.
This means you must browse every message on the queue and decide what to do for each one. Various tools, like M071, can do this. You could, if you were feeling like making your life difficult, use MQ Explorer to manually examine every message,and then record the Message ID of each message you want to pull, and then write something to remove those messages.
Other ways may make more sense, but you still need to non-destructively read *every* message on the queue. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue May 19, 2009 8:59 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
mqjeff wrote: |
Once a message is on a queue, the only way to do anything based on the existing contents of the existing message is to browse it,inspect the contents, and then decide what to do.
This means you must browse every message on the queue and decide what to do for each one. Various tools, like M071, can do this. You could, if you were feeling like making your life difficult, use MQ Explorer to manually examine every message,and then record the Message ID of each message you want to pull, and then write something to remove those messages.
Other ways may make more sense, but you still need to non-destructively read *every* message on the queue. |
Here a little word of advice model wise: (just wanted to add to Jeff's post for the newbies out there. Jeff is well versed with this design....)
For message content based routing the most efficient way is to write a little program that processes all messages from the input queue, routes them to the relevant destination queue and moves messages it can't route to an unresolved queue. Leaving messages untouched in the input queue is a recipe for pain and performance degradation....
Now with the new attributes of Version 7 and the version 7 servers you do have alternatives that are both powerfull and efficient, an allow for good performance.
Have fun  _________________ MQ & Broker admin |
|
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
|
|
|
|