You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by mburkhart <mb...@rcgdirect.com> on 2012/09/05 16:06:52 UTC

Re: Creating an exchange in the API

Is there a way to declare the exchange when creating a receiver (using the
Messaging API)?



--
View this message in context: http://qpid.2158936.n2.nabble.com/Creating-an-exchange-in-the-API-tp5425733p7581702.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

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


Re: Creating an exchange in the API

Posted by Gordon Sim <gs...@redhat.com>.
On 09/05/2012 03:06 PM, mburkhart wrote:
> Is there a way to declare the exchange when creating a receiver (using the
> Messaging API)?

Yes, you can do that using the address create option, along with 
appropriate node properties. You can set the fields of the declare 
issued as a result through the x-declare node property (which is a 
nested map). E.g. to create a durable exchange of type 'direct':

ssn.createReceiver("my-exchange; {create: always, node: {type: topic, 
durable:true, x-declare:{type:direct, 
alternate-exchange:another-exchange}}");

Node the node type of 'topic' is really a pseudonym for 'exchange' or 
the 'pub-sub' pattern. The AMQP exchange type is set in the x-declare.

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