qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pavel Moravec <pmora...@redhat.com>
Subject Re: Last Value Queue - Information Required
Date Mon, 31 Dec 2012 11:07:19 GMT
Hi Khan,
no, one queue is enough. See my favourite example below:

# create a LVQ named MyLVQ with values stored in header field "stock-symbol"
qpid-config add queue MyLVQ --argument qpid.last_value_queue_key=stock-symbol

# generate some messages with stock prices
$ qpid-send -a "MyLVQ" --property 'stock-symbol'='RHT' --property 'stock-value'='50' -m 1
$ qpid-send -a "MyLVQ" --property 'stock-symbol'='ORCL' --property 'stock-value'='50' -m 1
$ qpid-send -a "MyLVQ" --property 'stock-symbol'='RHT' --property 'stock-value'='53' -m 1
$ qpid-send -a "MyLVQ" --property 'stock-symbol'='MSFT' --property 'stock-value'='50' -m 1
$ qpid-send -a "MyLVQ" --property 'stock-symbol'='RHT' --property 'stock-value'='52' -m 1

# read the queue content - only the latest stock-symbol value will be printed
$ qpid-receive -a "MyLVQ" --print-headers yes --print-content no -m 10
Properties: {sn:1, stock-symbol:ORCL, stock-value:50, ts:1356948468924902877, x-amqp-0-10.routing-key:MyLVQ}

Properties: {sn:1, stock-symbol:MSFT, stock-value:50, ts:1356948468994528314, x-amqp-0-10.routing-key:MyLVQ}

Properties: {sn:1, stock-symbol:RHT, stock-value:52, ts:1356948469024261662, x-amqp-0-10.routing-key:MyLVQ}


Kind regards,

----- Original Message -----
> From: "Rajesh Khan" <rajeshkhan808@gmail.com>
> To: users@qpid.apache.org
> Sent: Monday, December 31, 2012 11:43:55 AM
> Subject: Last Value Queue - Information Required
> After reading about the LV queue. I wanted to implement the following
> scenario. I have 3 symbols A,B and C and I want the queue to always
> hold
> the latest prices of these symbols.
> My question is will I have to create a separate queue for each symbol
> ? Any
> suggestions would be appreciated.

To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org

View raw message