You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Shan Wang <Sh...@igindex.co.uk> on 2009/03/11 15:27:04 UTC

questions about the c++ failover example program

Hi All,

 

I'm a bit confused about the c++ failover example replay_sender and
resume_receiver. What kind of exchange are they using?

In the declare_queue.cpp in examples/failover, it only uses the
following line to declare the queue:

 

session.queueDeclare(arg::queue="message_queue");

 

There are no routing_key bindings for this queue. And in
replay_sender.cpp, sender sets routing_key the same as the queue name:

 

message.getDeliveryProperties().setRoutingKey(queue);

 

here queue is "message_queue". In resume_receiver.cpp, listener
subscribes to the queue directly:

 

subscription = subs.subscribe(*this, "message_queue");

 

So do failover sender and receiver use any kind of exchange? Will the
direct/fanout/topic exchange code work on failover connections?

 

 

Thanks & Regards,

Shan

 

The information contained in this email is strictly confidential and for the use of the addressee only, unless otherwise indicated. If you are not the intended recipient, please do not read, copy, use or disclose to others this message or any attachment. Please also notify the sender by replying to this email or by telephone (+44 (0)20 7896 0011) and then delete the email and any copies of it. Opinions, conclusions (etc.) that do not relate to the official business of this company shall be understood as neither given nor endorsed by it. IG Index plc is a company registered in England and Wales under number 01190902. VAT registration number 761 2978 07. Registered Office: Friars House, 157-168 Blackfriars Road, London SE1 8EZ. Authorised and regulated by the Financial Services Authority. FSA Register number 114059.

RE: questions about the c++ failover example program

Posted by Shan Wang <Sh...@igindex.co.uk>.
Thanks Alan, that explains it.

-----Original Message-----
From: Alan Conway [mailto:aconway@redhat.com] 
Sent: 11 March 2009 14:41
To: dev@qpid.apache.org
Subject: Re: questions about the c++ failover example program

Shan Wang wrote:
> Hi All,
> 
>  
> 
> I'm a bit confused about the c++ failover example replay_sender and
> resume_receiver. What kind of exchange are they using?
> 
> In the declare_queue.cpp in examples/failover, it only uses the
> following line to declare the queue:
> 
>  
> 
> session.queueDeclare(arg::queue="message_queue");
> 
>  
> 
> There are no routing_key bindings for this queue. And in
> replay_sender.cpp, sender sets routing_key the same as the queue name:
> 
>  
> 
> message.getDeliveryProperties().setRoutingKey(queue);
> 
>  
> 
> here queue is "message_queue". In resume_receiver.cpp, listener
> subscribes to the queue directly:
> 
>  
> 
> subscription = subs.subscribe(*this, "message_queue");
> 
>  
> 
> So do failover sender and receiver use any kind of exchange? Will the
> direct/fanout/topic exchange code work on failover connections?

Yes, they do. AMQP specifies that every broker has a default "nameless" 
exchange. This exchange is a direct exchange. When queues are created
they are 
automatically bound to this exchange by their name.

So you can send to any queue by using the empty string as an exchange
name and 
the queue name as routing key. This applies in general, its not specific
to 
failover.

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

The information contained in this email is strictly confidential and for the use of the addressee only, unless otherwise indicated. If you are not the intended recipient, please do not read, copy, use or disclose to others this message or any attachment. Please also notify the sender by replying to this email or by telephone (+44 (0)20 7896 0011) and then delete the email and any copies of it. Opinions, conclusions (etc.) that do not relate to the official business of this company shall be understood as neither given nor endorsed by it. IG Index plc is a company registered in England and Wales under number 01190902. VAT registration number 761 2978 07. Registered Office: Friars House, 157-168 Blackfriars Road, London SE1 8EZ. Authorised and regulated by the Financial Services Authority. FSA Register number 114059.

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


Re: questions about the c++ failover example program

Posted by Alan Conway <ac...@redhat.com>.
Shan Wang wrote:
> Hi All,
> 
>  
> 
> I'm a bit confused about the c++ failover example replay_sender and
> resume_receiver. What kind of exchange are they using?
> 
> In the declare_queue.cpp in examples/failover, it only uses the
> following line to declare the queue:
> 
>  
> 
> session.queueDeclare(arg::queue="message_queue");
> 
>  
> 
> There are no routing_key bindings for this queue. And in
> replay_sender.cpp, sender sets routing_key the same as the queue name:
> 
>  
> 
> message.getDeliveryProperties().setRoutingKey(queue);
> 
>  
> 
> here queue is "message_queue". In resume_receiver.cpp, listener
> subscribes to the queue directly:
> 
>  
> 
> subscription = subs.subscribe(*this, "message_queue");
> 
>  
> 
> So do failover sender and receiver use any kind of exchange? Will the
> direct/fanout/topic exchange code work on failover connections?

Yes, they do. AMQP specifies that every broker has a default "nameless" 
exchange. This exchange is a direct exchange. When queues are created they are 
automatically bound to this exchange by their name.

So you can send to any queue by using the empty string as an exchange name and 
the queue name as routing key. This applies in general, its not specific to 
failover.

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