qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fraser Adams <fraser.ad...@blueyonder.co.uk>
Subject Re: Subject 'filters' (was Re: couple of proton Messenger questions.)
Date Tue, 05 Aug 2014 17:51:21 GMT
Hi Gordon,
I'm aware of the AMQP 1.0 filter stuff, but I'm a little confused by 
this post as I was pretty sure that the broker also worked with 
"traditional" topic/subject addresses and 
<qpid>/cpp/src/qpid/messaging/AddressHelper.cpp translated automagically 
to a filter applied to the message source. In other words

A consumer like the following using the address amq.topic/*.news i.e. a 
wildcarded topic/subject subscription

./drain --connection-options {protocol:amqp1.0} -b localhost -f \
"amq.topic/*.news; {link: {name: test-link}}"

Causes it to successfully receive messages from both:
./spout --connection-options {protocol:amqp1.0} -b localhost --content 
"Hello World" "amq.topic/USA.news"
./spout --connection-options {protocol:amqp1.0} -b localhost --content 
"Hello World" "amq.topic/UK.news"

but not from:
./spout --connection-options {protocol:amqp1.0} -b localhost --content 
"Hello World" "amq.topic/UK.weather"

I've literally just tried that and it does what I say above and doing 
qpid-config -r queues shows

Queue 'e0b8b1e7-fac5-4b51-b714-191ea14ab61b_test-link'
     bind [e0b8b1e7-fac5-4b51-b714-191ea14ab61b_test-link] => ''
     bind [*.news] => amq.topic

So clearly the correct binding has been set up.



I can also do it explicitly via by specifying the filter in the link 
config, e.g.

./drain --connection-options {protocol:amqp1.0} -b localhost -f \
"amq.topic; {link: {name: test-link, filter: {name: 'subject-filter', 
descriptor: 'apache.org:legacy-amqp-topic-binding:string', value: 
'*.news'}}}"

But as far as I was aware that's just the explicit long hand form of the 
first example.



I'm afraid that I've clearly missed what you are getting at below, 
sorry!! :-(

Unfortunately nobody has yet got back to me about the Messenger related 
questions I posted the other day, but to be clear what I was trying to 
get at was that as far as I was aware there isn't yet a way with 
Messenger to subscribe to anything other than a simple, basic node 
address, so for example if I do:

./recv localhost/#
it's fine and I get a dynamically created queue, and if I have a queue 
called test I can do
./recv localhost/test
and it's happy, also if I subscribe to a topic Node e.g.
./recv localhost/amq.topic
That works and I get an automagic subscription queue with a # wildcard 
binding e.g.

Queue 'e50b5f02-eeb1-409a-a07f-7ac2c7f06b6c_receiver-xxx'
     bind [e50b5f02-eeb1-409a-a07f-7ac2c7f06b6c_receiver-xxx] => ''
     bind [#] => amq.topic


However, if I were to do
./recv localhost/amq.topic/*.news

It barfs with:
LINK ERROR (amqp:not-found) Node not found: amq.topic/*.news


And I don't believe that using explicit link config like I used to 
explicitly specify the topic filter is currently supported either.


Am I making sense? Basically unless I've totally missed something 
Messenger only allows subscriptions to basic Node addresses and doesn't 
yet support filters or any other link config. Is that correct? If so it 
that on anybody's TODO list? I guess I find it surprising not to be 
supported. If it's on nobody's priority I might take a look at it when I 
get my JavaScript stuff finished off, but equally if anyone is planning 
on working on this I'm in no real rush to brush off my C ;->

I'd really appreciate answers to the other questions in my other post 
too if anyone happens to know them.

Cheers,
Frase

On 04/08/14 11:48, Gordon Sim wrote:
> On 08/03/2014 02:23 PM, Fraser Adams wrote:
>> I can subscribe to receive messages from a simple Node address but say I
>> want to subscribe to a particular subject say amq.topic/UK.WEATHER and
>> the like, that's pretty easy via an Address String in qpid::Messaging or
>> JMS but it still doesn't seem possible with Messenger?
>
> The c++ broker currently handles subject based filtering like this 
> through an AMQP 1.0 'filter'[1], since these extensions were already 
> registered and it seemed at the time to be the most obvious 
> interpretation of the core spec's intent.
>
> However, I've been thinking that it would make sense to add support 
> for passing the subject 'filter' as part of the source address as 
> well. I believe the java broker already does this and it seems in 
> reality to be the more common pattern (e.g. ActiveMQ and RabbitMQ)[2]. 
> This pattern doesn't require any special client support for setting 
> filters.
>
> [1] specifically the 'legacy-amqp filters from 
> http://svn.apache.org/viewvc/qpid/trunk/qpid/specs/apache-filters.xml?view=markup
>
> [2] For 'exact match' semantics the same pattern would work against 
> the Dispatch Router as well.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>


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


Mime
View raw message