tree: c61eea5717def0e7a616ae7ca16d91293d1798ce [path history] [tgz]
  1. src/
  2. pom.xml
  3. readme.md
examples/features/standard/last-value-queue/readme.md

Last-Value Queue Example

To run the example, simply type mvn verify from this directory, or mvn -PnoServer verify if you want to start and create the broker manually.

This example shows you how to configure and use last-value queues.

Last-Value queues are special queues which discard any messages when a newer message with the same value for a well-defined Last-Value property is put in the queue. In other words, a Last-Value queue only retains the last value.

A typical example for Last-Value queue is for stock prices, where you are only interested by the latest value for a particular stock.

The example will send 3 messages with the same Last-Value property to a to a Last-Value queue.

We will browse the queue and see that only the last message is in the queue, the first two messages have been discarded.

We will then consume from the queue the last message.