qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Virgilio Alexandre Fornazin" <virgilioforna...@gmail.com>
Subject RE: How to set a binding on a receiver
Date Wed, 05 Oct 2011 11:50:53 GMT
Luca

We made a 'workaround' to accomplish this (that was supported by old-style
Qpid client api, but not for Qpid messaging api).

We create two sessions: one for 'management' purposes and other for 'message
exchange' purposes.

First, we create a Receiver for 'queue declaration' in browse mode with
capacity 0 with the syntax (for example), using the 'management' session:

"TestQueue ; { mode: browse, assert: always, create: always, delete: always,
node: { type: queue, durable: false, x-declare: { auto-delete: true,
arguments: { qpid.max_size: 33554432, qpid.max_count: 2147483647,
qpid.policy_type: flow_to_disk } } } }"

Next, we declare a binding with direct exchange (in browse mode too and
capacity 0), in 'management' session too:

"TestQueue ; { mode: browse, assert: always, create: always, delete: always,
node: { type: queue, durable: false, x-declare: { auto-delete: true,
arguments: { qpid.max_size: 33554432, qpid.max_count: 2147483647,
qpid.policy_type: flow_to_disk } }, x-bindings: [{ exchange: amq.direct,
queue: TestQueue, key: TestQueue }] } }"

After that, we create new Receivers for declaring the 'dynamic' queue
bindings (using browse mode too and capacity 0), for example, binding
TestQueue to topic Foo.Bar.*):

"TestQueue ; { mode: browse, assert: always, create: always, delete: always,
node: { type: queue, durable: false, x-declare: { auto-delete: true,
arguments: { qpid.max_size: 33554432, qpid.max_count: 2147483647,
qpid.policy_type: flow_to_disk } }, x-bindings: [{ exchange: amq.topic,
queue: TestQueue, key: Foo.Bar.* }] } }"

And we keep those receivers in a collection to keep track of then. When we
don't need a binding anymore, closing the receiver will delete the binding
(using auto-delete: true).

And for I/O, we create a Receiver in 'message exchange' session with the
following syntax, using capacity 512:

"TestQueue ; { mode: consume, node: { type: queue } }"

With that, we can use a pooling thread using the common messaging api
syntax:

Receiver rcvr = messageSession.nextReceiver(Duration);



It's not the 'right' mode ? I'm unsure, but´s the only way since Qpid
messaging api is too simple and the Qpid client Api is C++ only (we use this
api in C++ and C# world, so we need to perform equals on both sides).



-----Original Message-----
From: Luca Martini [mailto:l.martini@list-group.com] 
Sent: quarta-feira, 5 de outubro de 2011 05:33
To: users@qpid.apache.org
Subject: How to set a binding on a receiver

Hi all,
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?

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?

Do you think there is a practical limit on the number of bindings a Receiver
can have?
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.

Many thanks for your help.
     Luca


--
Luca Martini
List S.p.A.
Via Pietrasantina 123, 56122 Pisa, ITALY
+39 050 8001696 (Direct)
+39 050 800151  (Switch)
+39 050 8001701 (Fax)
e-mail: l.martini@list-group.com  web: http://www.list-group.com


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


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


Mime
View raw message