You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Jim Alateras <ji...@comware.com.au> on 2007/07/01 08:25:47 UTC

setting a policy on a particular queue

I have a queue which i use to publish the status of the device.

The consumer will dequeue the status and send it to a central management
system at a configurable frequency. The publisher will publish a new
status only when there is a change in the device state.

In some circumstances the queue will contain multiple device messages
but only the most recent one is valid.

I was wondering whether there was a way to apply the following policy to
the queue  such that it only holds the most recent device status.

Can I limit the size of the queue to 1 message; the most recent one.

cheers
</jima>


Re: setting a policy on a particular queue

Posted by James Strachan <ja...@gmail.com>.
On 7/1/07, Jim Alateras <ji...@comware.com.au> wrote:
> I have a queue which i use to publish the status of the device.
>
> The consumer will dequeue the status and send it to a central management
> system at a configurable frequency. The publisher will publish a new
> status only when there is a change in the device state.
>
> In some circumstances the queue will contain multiple device messages
> but only the most recent one is valid.
>
> I was wondering whether there was a way to apply the following policy to
> the queue  such that it only holds the most recent device status.
>
> Can I limit the size of the queue to 1 message; the most recent one.

There's no pre-defined queue-size-limited policy yet I'm afraid.
Messages can be discarded on a per-consumer basis on topics; along
with last-image caching and so forth; but we don't yet support a fixed
size queue where older messages are discarded. Though the broker
implementation is extensible; so you could plugin your own particular
provider via the DestinationFactory

http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/broker/region/DestinationFactory.html

Having some kind of fixed size queue (with a configurable policy for
deciding which message gets evicted from the queue) sounds like an
interesting new feature; I can imagine others wanting something like
this
-- 
James
-------
http://macstrac.blogspot.com/