+1 this question - I've never quite understood Messenger's current behavior
w.r.t. setting the source and target to the same value.
As far as interpreting the behavior of a subscription, and the interaction with
the API, I would think the most 'natural' approach would be:
sub = M.subscribe("amqp://~0.0.0.0/name") would imply:
> > "I am a service called 'name'
> > and I wish to begin receiving messages"
and
sub = M.subscribe("amqp://0.0.0.0/name") would imply:
> > "I wish to receive messages
> > from a node called 'name'".
As the ~ causes Messenger to open a TCP listener on the address, and the
absence of ~ causes Messenger to initiate a connection attempt to the address.
In the two cases, I agree with Ted's point that only the Target or Source
should be set. My opinion: set them based on the subscription's mode: Target
should be set in the case of ~, Source in the case of !~.
Thoughts?
-K
----- Original Message -----
> From: "Ted Ross" <[email protected]>
> To: [email protected]
> Sent: Friday, February 21, 2014 3:42:21 PM
> Subject: Re: Source/Target Question
>
> Based on a discussion with Gordon, I'm not going to use source vs.
> target to infer any intent on the part of the peer node.
>
> I am, however, still interested in the answer to the question.
>
> -Ted
>
> On 02/21/2014 03:02 PM, Ted Ross wrote:
> > I'm working on a feature for Dispatch Router that will allow it to
> > intermediate between clients and brokers. This raises a question
> > about how Proton Messenger handles targets and sources in links.
> >
> > Consider a subscriber using Messenger:
> >
> > from proton import Messenger
> > M = Messenger()
> > M.start()
> > sub = M.subscribe("amqp://0.0.0.0/name")
> >
> > The resulting incoming link (from Messenger's perspective) has a
> > source of "name" and a target of "name".
> >
> > The above code can have two meanings: "I am a service called 'name'
> > and I wish to begin receiving messages" or "I wish to receive messages
> > from a node called 'name'".
> >
> > As I understand it, the first meaning should be indicated by setting
> > the target and the second meaning by setting the source. Since both
> > source and target are set, the intent of the node is ambiguous.
> >
> > From an API perspective, how should a Messenger program indicate which
> > flavor of subscription it is establishing?
> >
> > -Ted
> >
>
>
--
-K