You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Jiri Krutil <ji...@krutil.com> on 2011/06/27 13:49:49 UTC

Declaring exchanges, queues/bindings using C++ client

Hi

Using the C++ messaging client (v0.7), is it possible to declare an  
exchange by creating a Sender and closing it without ever sending a  
message, assuming I use the right address with type:exchange and  
create:always?

Similarly, is it possible to declare a queue and its bindings by  
creating a Receiver and closing it without trying to receive a  
message? The address has type:exchange, create:always and a list of  
bindings in the x-bindings part.

If the above is incorrect, can you please suggest another way which  
does not force me to send/receive any messages?

Cheers
Jiri


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


Re: Declaring exchanges, queues/bindings using C++ client

Posted by Gordon Sim <gs...@redhat.com>.
On 06/27/2011 12:49 PM, Jiri Krutil wrote:
> Using the C++ messaging client (v0.7), is it possible to declare an
> exchange by creating a Sender and closing it without ever sending a
> message, assuming I use the right address with type:exchange and
> create:always?

Yes, although the type should be 'topic'.

> Similarly, is it possible to declare a queue and its bindings by
> creating a Receiver and closing it without trying to receive a message?
> The address has type:exchange, create:always and a list of bindings in
> the x-bindings part.

The address the there should be 'queue'. The x-bindings should be 
declared in the node, not the link (else they will be unbound when the 
link, i.e. the receiver, is closed).

> If the above is incorrect, can you please suggest another way which does
> not force me to send/receive any messages?

It's not incorrect.

Personally, I dislike the approach (though it will work). It creates 
things as a side effect and isn't really the intended use case.

My preference is to send the broker special management messages to 
request creation of 'static' broker entities such as exchanges and 
shared queues. It allows a more explicit approach to broker management 
which I think is nicer. However that has only been possible on the 
broker since 0.10.



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