On 07/08/2013 05:20 PM, Pablo Rodríguez Rey wrote:
On Mon, Jul 8, 2013 at 6:01 PM, Gordon Sim <[email protected]> wrote:
On 07/05/2013 03:30 PM, Pablo Rodríguez Rey wrote:
I can send and receive messages using AMQP URLs:
amqp://127.0.0.1/route
But I dont know how to set the paramers to active the selector/filters for
selecting only messages with priority=5 or priority>5 (examples), tried a
lot of combinations:
amqp://127.0.0.1/route?header.**priority=5<http://127.0.0.1/route?header.priority=5>
amqp://127.0.0.1/route?header.**priority%3E5<http://127.0.0.1/route?header.priority%3E5>
amqp://127.0.0.1/route?**transport.transformer=jms&**priority=E5<http://127.0.0.1/route?transport.transformer=jms&priority=E5>
amqp://127.0.0.1/route?**transport.transformer=jms&**priority%3E5<http://127.0.0.1/route?transport.transformer=jms&priority%3E5>
amqp://127.0.0.1/route?**transport.transformer=jms&**header.priority=E5<http://127.0.0.1/route?transport.transformer=jms&header.priority=E5>
amqp://127.0.0.1/route?**transport.transformer=jms&**header.priority%3E5<http://127.0.0.1/route?transport.transformer=jms&header.priority%3E5>
...
First, I don't believe the the Qpid Proton Messenger API (which I assume
from the subject is what you are using?) provides any way to set a filter
on attach.
In deed, there is no Proton API for doing that, so I guessed it will be
only available using parameters in AMQP address.
It isn't available that way either. The filter is a specific field on
the source for the attach request and the proton-c messenger only ever
sets the address on the source, never the filter.
Second, though I could be wrong as I too am new to ActiveMQ, it also looks
like the AMQP transport for ActiveMQ does not support the selector filter
extension(?). Certainly in my experiments it doesn't apply any filtering.
I don't know so, I did several trys but the only thing I need to do is find
in the source code of ActiveMQ.
Turns out I was indeed wrong (all too common I'm afraid)! Your
suggestion to look at the source code showed that ActiveMQ _does_
support a filter, but it requires the name to be jms-selector (and
doesn't care about the descriptor used).
(Also the filter supported uses JMS names rather than the translated
names for AMQP as described in
https://svn.apache.org/repos/asf/qpid/trunk/qpid/specs/apache-filters.xml#type-selector-filter,
e.g. in this case the selector would be 'JMSPriority > 5', which does
indeed work as expected).