qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Sim <g...@redhat.com>
Subject Re: C++ Messaging API: getReceiver(topic/subject)
Date Thu, 01 Jun 2017 16:58:31 GMT
On 01/06/17 16:13, mottese wrote:
> Hi, I'm trying to use getReceiver, but am not getting the results I'm
> expecting. For example, this is what I'm doing:
>
>   Session session = con.getSession();
>   Address addr("amq.topic/mySubject");
>   session.createReceiver(addr);
>   ...
>   ...
>   Receiver r = session.getReceiver("amq.topic/mySubject");
>
> This is throwing a KeyError and I can't figure out why. Any help would be
> appreciated.

You need to use the receivers 'name' to retrieve it via the 
getReceiver() call. The name for the receiver is based on the 'name' of 
the thing in the address - aka the 'node', which in your case is 
amq.topic (the mySubject part is the subject).

If you have only one receiver on the session for a given node 
(exchange/queue) then the receiver name will match that. If not, the 
receiver name is qualified with a unique counter, e.g. amq.topic_1, 
amq.topic_2 etc.


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


Mime
View raw message