qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken Giusti <kgiu...@redhat.com>
Subject Re: Question re: Java broker's message selector implementation...
Date Thu, 17 Nov 2011 14:28:11 GMT
Hi Rob, thanks for the info - very helpful.  I'll write up a more formal description of the
proposed functionality shortly - give us something a little more tangible to review.

One question specific to the Java broker's behavior - an edge-case I'm trying to wrap my head

With selectors, I'm planning on associating a current position with each consumer - just as
you described below.  This is somewhat new to the C++ broker, as currently all consumers consume
from the queue's head.  A position attribute adds a new wrinkle to the broker's handling of
released messages:

Does the Java broker reset/rewind a consumer's position when an acquired message is released
back to the queue?  For example, assume a queue with multiple subscribers consuming from it
in parallel, with the potential that their selector match criteria overlaps.  If a consumer
acquires a message, then at some later point releases it, does the Java broker 'back up' the
other consumers that may have skipped over that message due to it being acquired?



----- Original Message -----
> Hi Ken,
> On 15 November 2011 19:43, Ken Giusti <kgiusti@redhat.com> wrote:
> > Hi folks,
> >
> > I'm working on adding support for server-side message selectors to
> > the C++
> > Broker.
> >
> > See https://issues.apache.org/jira/browse/QPID-530  (better late
> > than
> > never...)
> >
> >
> Excellent... not having to implement selectors on the client side
> will be a
> real win!
> > It would be preferable to have the C++ broker's use model for
> > message
> > selectors be consistent with the Java Broker's implementation - and
> > I
> > believe the Java Broker already implements Message Selectors
> > (correct?)
> >
> >
> The Java Broker does indeed implement message selectors
> > I was planning on implementing the feature's behavior so it will be
> > compliant with the description of Message Selections as per the JMS
> > 1.1
> > spec.  Is this the model for message selectors that is supported by
> > the
> > Java Broker?  If not, is there documentation available that
> > describes its
> > implementation?
> >
> >
> I'm not sure if there is any documentation on message selectors and
> their
> implementation.  One thing to be aware of is that selectors probably
> need
> to be implemented both on the queue consumers and (because of the way
> that
> AMQP models topics) on the bindings between exchanges and queues.
> The bindings model is easier since you are just implementing an
> additional
> filter on which messages are routed to a given queue through the
> exchange,
> and the JMS Selector is simply another filter to evaluate in
> conjunction
> with the other tests associated with a given binding.
> For the queue consumer implementation, this basically depends on the
> queue
> implementation.  The way that the Java Broker works internally, each
> consumer keeps a pointer into the queue, the pointer is advanced when
> the
> consumer has capacity to receive a message, and the message at the
> pointer
> is evaluated against the criteria of the consumer (e.g. the message
> selector, whether the consumer is "no-local" or not).
> IIRC the selector is passed to the consumer as an argument called
> "x-filter-jms-selector" where the value is a selector in the defined
> selector syntax (the same name is used to pass the selector when
> binding a
> queue to an exchange for topic style selectors).
> Also note that I believe there has recently been some work done to
> identify
> on connection whether a broker supports selectors or not, so that the
> Java
> client can determine whether it needs to use the client-side
> selectors or
> can utilise the server side selectors (
> https://issues.apache.org/jira/browse/QPID-3518) - if you implement
> selectors in the C++ broker you should advertise this through the
> connection properties in the same way.
> Cheers,
> Rob

Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org

View raw message