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: [email protected] For additional commands, e-mail: [email protected]
