You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by StanleyH <st...@gmail.com> on 2006/09/01 03:39:15 UTC

can i consume a particular message in the queue?

hi, I need to consume/delete a particular message in the queue. I am using
queuebrowser to iterate through each message and when the user wants to
delete the message currently pointing by the iterator I create consumer with
selector = that messageID? to consume it? are there better methods for doing
it?
I am trying to store a count for the number of times a message's been read
by recipient too.  thanks for any help.
-- 
View this message in context: http://www.nabble.com/can-i-consume-a-particular-message-in-the-queue--tf2200245.html#a6091467
Sent from the ActiveMQ - User forum at Nabble.com.


Re: can i consume a particular message in the queue?

Posted by Rob Davies <ra...@gmail.com>.
On 1 Sep 2006, at 02:39, StanleyH wrote:

>
> hi, I need to consume/delete a particular message in the queue. I  
> am using
> queuebrowser to iterate through each message and when the user  
> wants to
> delete the message currently pointing by the iterator I create  
> consumer with
> selector = that messageID? to consume it? are there better methods  
> for doing
> it?
This looks reasonable to me (especially if you are only going to use  
the JMS API).
> I am trying to store a count for the number of times a message's  
> been read
> by recipient too.  thanks for any help.
If you mean read by a browser - there's no way you can currently do  
that!
> -- 
> View this message in context: http://www.nabble.com/can-i-consume-a- 
> particular-message-in-the-queue--tf2200245.html#a6091467
> Sent from the ActiveMQ - User forum at Nabble.com.
>


Re: can i consume a particular message in the queue?

Posted by Jamie McCrindle <ja...@gmail.com>.
Hi Stanley,

Having done something similar, I'd recommend using a database. Queues
are great for many things like load balancing, sending messages really
quickly and running persistent queries. They're not so great for doing
lookups for particular messages based on some criteria as neither the
messageId nor the message properties are indexed.

cheers,
j.

On 9/1/06, StanleyH <st...@gmail.com> wrote:
>
> hi, I need to consume/delete a particular message in the queue. I am using
> queuebrowser to iterate through each message and when the user wants to
> delete the message currently pointing by the iterator I create consumer with
> selector = that messageID? to consume it? are there better methods for doing
> it?
> I am trying to store a count for the number of times a message's been read
> by recipient too.  thanks for any help.
> --
> View this message in context: http://www.nabble.com/can-i-consume-a-particular-message-in-the-queue--tf2200245.html#a6091467
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>

Re: can i consume a particular message in the queue?

Posted by James Strachan <ja...@gmail.com>.
You can also use the MBean to remove a specific message

http://incubator.apache.org/activemq/maven/activemq-core/apidocs/org/apache/activemq/broker/jmx/QueueViewMBean.html#removeMessage(java.lang.String)

On 9/1/06, StanleyH <st...@gmail.com> wrote:
>
> hi, I need to consume/delete a particular message in the queue. I am using
> queuebrowser to iterate through each message and when the user wants to
> delete the message currently pointing by the iterator I create consumer with
> selector = that messageID? to consume it? are there better methods for doing
> it?
> I am trying to store a count for the number of times a message's been read
> by recipient too.  thanks for any help.
> --
> View this message in context: http://www.nabble.com/can-i-consume-a-particular-message-in-the-queue--tf2200245.html#a6091467
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/