qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Sim <g...@redhat.com>
Subject Re: Sender name vs address (C++ messaging API)
Date Tue, 16 Aug 2011 16:05:06 GMT
On 08/16/2011 04:16 PM, Toralf Lund wrote:
> The QPid "messaging" API will allow me to create a sender by address,
> but (only) look up existing senders by name - the
> qpid::messaging::Session class has:
> Sender createSender(const Address &address);
> Sender createSender(const std::string &address);
> Sender getSender(const std::string &name);
> Can I make *any* assumptions about the name given an address? Is there a
> way to look up a sender created earlier for an address? Or isn't this
> supposed to be possible? In that case, what exactly is getSender() for?
> I mean, I'm assuming name is given by Sender::getName(), but requiring a
> Sender to allow the lookup sort of defeats the purpose of the whole
> method. OK, you can could maintain an address-to-name map, but then it's
> probably easier to store the Sender objects.
> It seems like the name is quite simply identical to the address if
> something simple like a queue name was passed on create, but I suspect
> it's not quite that simple for more complex addresses...

At present the C++ client will use the address name as the name for the 
sender or receiver where it can do so without ambiguity.

If you create two senders (or two receivers) for the same address, then 
the second will have a numeric suffix added to the name to distinguish them.

So e.g.

   Sender s1 = ssn.createSender("my-node");
   Sender s2 = ssn.createSender("my-node/my-subject");

would result in s1 having name 'my-node', but s2 having name 'my-node_2'.

I would like to augment the logic to use the link name instead of the 
node name if explicitly specified in order to give more control where 
that is needed. Does that sound useful to you?

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

View raw message