On 7/1/07, Jim Alateras <[EMAIL PROTECTED]> 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/