activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: LastImage-style topic
Date Wed, 31 May 2006 12:48:44 GMT
So there are 2 different issues discussed in this mail; dealing with
slow consumers typically means  choosing which messages to discard
(the default is the older messages). Then
LastImageSubscriptionRecoveryPolicy is to do with when a new
subscription is created, does it receive old messages (such as the
last image that was sent on the topic).


On 5/31/06, Kuppe <kuppe@360t.com> wrote:
>
> I am trying to manage slow consumers for topics. Your documentation regarding
> policyEntries suggests that it is possible to "configure the maximum number
> of matched messages the broker will keep around for a consumer in addition
> to its prefetch buffer" - this is called the PendingMessageLimitStrategy.
> When this limit is reached it is possible to define a strategy for removing
> "older messages" defined by the eviction strategy - this is called the
> MessageEvictionStrategy.
>
> I would like to use the example of a topic publishing market data for a
> specific symbol but from multiple sources. It is only important that the
> most recent update from each source is available to topic consumers.
> Accordingly the examples shown in your slow consumer handling page are not
> really relevant. I am interested that a new message simply overwrites the
> previous message where the symbol and source match. This would then always
> return the latest price to the consumer given the context of the producer.
>
> From your description it seems that the LastImageSubscriptionRecoveryPolicy
> does somthing like this although only for recovering subscriptions. With the
> extension of course that a specific strategy defines which messages make up
> the last image set.
>
> Is there any way that i can handle this using the features above?

So I think its sounding like you want to write a
MessageEvictionStrategy which tries to find old messages such that
there is a newer message available. e.g. if there are 5 messages for
IBM then evict all but the latest.


> In addition, if i was to define a destination policyEntry with
> topic="*UpdateQuotes" will this match to all topic names that end in
> "UpdateQuotes"?

Not quite. *.UpdateQuotes would match stuff with any name for * but *
only matches one name.

So A.UpdateQuotes and B.UpdateQuotes would match but not A.B.UpdateQuotes.

To match an entire tree you might want to switch around your namespace to

UpdateQuotes.>

So that would match UpdateQuotes.A and UpdateQuotes.A.B.C etc

-- 

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

Mime
View raw message