qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Sim <g...@redhat.com>
Subject Re: How to set a binding on a receiver
Date Wed, 05 Oct 2011 10:28:52 GMT
On 10/05/2011 09:32 AM, Luca Martini wrote:
> I am using Apache qpid C++ broker and the messaging API.
> I understand that you can create a binding by specifying the correct
> x-bindings property on the address passed to the createReceiver method.
> However, I would like to add a key binding to an already created Receiver.
> Is it possible?

Not directly through the messaging API, no.

> I have started looking at the QMF engine library, but I'm not able to
> find any useful documentation on the topic. If it's the right (and only)
> way to do that could you please point me to some examples or tutorials?

I've attached some notes I wrote up that while very far from complete 
may help give an overview of how QMF works for manipulating bindings. 
This uses the protocol directly using the messaging API rather than the 
QMF API (someone else perhaps will be able to give examples of the latter).

I've also attached a simple example showing dynamic addition of 
bindings. If you compile and run the attached test program you can 
control the bindings in place for the receivers queue by sending 
messages to my-queue/control.

e.g. using the bundled spout example

   spout -M exchange=amq.topic -M key=my-key my-queue/control
   spout --content 'Hello World!' amq.topic/my-key

Should now see the message from the test program.

   spout -M exchange=amq.direct -M key=another-key my-queue/control
   spout --content 'Hello Again!' amq.direct/another-key

And again, this message should also now be seen.

> Do you think there is a practical limit on the number of bindings a
> Receiver can have?

Nothing hard and fast.

> On a more methodological side, I am asking these questions because I
> would want to avoid to create one queue for subscription. My concern is
> that, with hundreds (or thousands) of subscriptions, the broker could
> become a bottleneck for our system. I know I'm being rather vague, but
> if you could give me some suggestions or remarks, it would be very
> appreciated.

I suspect it depends a lot on the details of the bindings, exchange and 
matching patterns. If each message matches only one binding, I suspect 
that there is no great benefit to using the same queue in each binding. 
However if the bindings overlap a lot then this may change.

Probably the best thing to do is experiment a little around the actual 
patterns you envisage and see what gives the best results.

View raw message