You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Marc Pellmann <pe...@gmail.com> on 2018/01/29 17:28:50 UTC

Link handling after detach(close=false)

Hi,

I work on the Eclipse Hono project, where we use the qpid router.

In a specific situation, I am not sure about the expected behavior and hope
you can help me out.

In our default/example setup there is a qpid router in front of a Artemis
broker and a client, which opens a receiver link to qpid (and qpid creates
a link to Artemis for this address).

Initially all works as expected and messages, wich are send to the Artemis
address are received by the receiver.

When the broker is killed, the qpid sends a detach with closed=false (on
this I would assume that also a detach with closed=false should be send
back from the receiver).

If now, the broker is started again, the receiver gets no attach frame and
does not receive messages. (It gets an attach and receive messages, if it
is also restarted.)

My expectation was, that qpid would establish the link with the broker and
send an attach frame to the receiver.

Is the expected behavior from the receiver, that after a detach with
closed=false it need to close and try to open until the Broker is available
again?

Marc

Re: Link handling after detach(close=false)

Posted by Gordon Sim <gs...@redhat.com>.
On 31/01/18 15:47, Hudalla Kai (INST/ECS4) wrote:
> The consumer is currently simply opening a receiver link (attach with no specific capabilities nor options) to the router, which then opens a link to the broker, I assume.

In which case the distinction between close=true and close=false is not 
relevant as the link is closed on detach regardless.

> What would I need to do in order to create a "durable" subscription? There is no standard way defined in AMQP 1.0 for doing this, is there?

You set the the durable property of the source to true and specify an 
expiry-policy of 'never'.

> If this is an Artemis specific feature, is there some documentation available?
> 
> My assumption is that, if I had created a durable link/subscription, that once my consumer has re-attached after the detach (close=false) had been received, then the broker will deliver all messages that have been put to the broker while the consumer was "detached" instead of just receiving new messages over the re-established link, right?

Right.

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


Re: Link handling after detach(close=false)

Posted by "Hudalla Kai (INST/ECS4)" <ka...@bosch-si.com>.
On 30.01.2018 13:48, Gordon Sim wrote:
On 30/01/18 12:03, Hudalla Kai (INST/ECS4) wrote:
Is it also ok for the receiver to send an attach with close=true in response to the reouter's detach (close=false), effectively closing the link for good?

No, that would not work. The close actually needs to get to the broker, which is where the subscription is held. However the detach from the router is an indication that 'connection' to the broker has been lost. It is in some ways similar to losing the tcp connection when directly subscribed to a broker.

In order to close the link for good, you would need to re-establish the link (through the router, to the broker) and then close it.

*However*, if you don't want the subscription to survive such disconnection, you can simply avoid making it durable and expiring on link detach. Then the distinction between detach with closed=true and closed=false is irrelevant.

The consumer is currently simply opening a receiver link (attach with no specific capabilities nor options) to the router, which then opens a link to the broker, I assume.

What would I need to do in order to create a "durable" subscription? There is no standard way defined in AMQP 1.0 for doing this, is there?
If this is an Artemis specific feature, is there some documentation available?

My assumption is that, if I had created a durable link/subscription, that once my consumer has re-attached after the detach (close=false) had been received, then the broker will deliver all messages that have been put to the broker while the consumer was "detached" instead of just receiving new messages over the re-established link, right?

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


--

Mit freundlichen Grüßen / Best regards

Kai Hudalla
Chief Software Architect

Bosch Software Innovations GmbH
Ullsteinstraße 128
12109 Berlin
GERMANY
www.bosch-si.com<http://www.bosch-si.com>

Registered Office: Berlin, Registration Court: Amtsgericht Charlottenburg; HRB 148411 B
Chairman of the Supervisory Board: Dr.-Ing. Thorsten Lücke; Managing Directors: Dr. Stefan Ferber, Michael Hahn

Re: Link handling after detach(close=false)

Posted by Gordon Sim <gs...@redhat.com>.
On 30/01/18 12:03, Hudalla Kai (INST/ECS4) wrote:
> Is it also ok for the receiver to send an attach with close=true in response to the reouter's detach (close=false), effectively closing the link for good?

No, that would not work. The close actually needs to get to the broker, 
which is where the subscription is held. However the detach from the 
router is an indication that 'connection' to the broker has been lost. 
It is in some ways similar to losing the tcp connection when directly 
subscribed to a broker.

In order to close the link for good, you would need to re-establish the 
link (through the router, to the broker) and then close it.

*However*, if you don't want the subscription to survive such 
disconnection, you can simply avoid making it durable and expiring on 
link detach. Then the distinction between detach with closed=true and 
closed=false is irrelevant.

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


Re: Link handling after detach(close=false)

Posted by "Hudalla Kai (INST/ECS4)" <ka...@bosch-si.com>.
On 30.01.2018 11:28, Gordon Sim wrote:
On 30/01/18 06:15, Kai wrote:
Gordon,

by "it" you are referring to the consumer/receiver, correct?

Yes, the application receiving messages.

Is it also ok for the receiver to send an attach with close=true in response to the reouter's detach (close=false), effectively closing the link for good?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org<ma...@qpid.apache.org>
For additional commands, e-mail: users-help@qpid.apache.org<ma...@qpid.apache.org>


--

Mit freundlichen Grüßen / Best regards

Kai Hudalla
Chief Software Architect

Bosch Software Innovations GmbH
Ullsteinstraße 128
12109 Berlin
GERMANY
www.bosch-si.com<http://www.bosch-si.com>

Registered Office: Berlin, Registration Court: Amtsgericht Charlottenburg; HRB 148411 B
Chairman of the Supervisory Board: Dr.-Ing. Thorsten Lücke; Managing Directors: Dr. Stefan Ferber, Michael Hahn

Re: Link handling after detach(close=false)

Posted by Gordon Sim <gs...@redhat.com>.
On 30/01/18 06:15, Kai wrote:
> Gordon,
> 
> by "it" you are referring to the consumer/receiver, correct?

Yes, the application receiving messages.

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


Re: Link handling after detach(close=false)

Posted by Kai <so...@gmail.com>.
Gordon,

by "it" you are referring to the consumer/receiver, correct?

Kai

Gordon Sim <gs...@redhat.com> schrieb am Mo., 29. Jan. 2018, 21:30:

> On 29/01/18 17:28, Marc Pellmann wrote:
> > Hi,
> >
> > I work on the Eclipse Hono project, where we use the qpid router.
> >
> > In a specific situation, I am not sure about the expected behavior and
> hope
> > you can help me out.
> >
> > In our default/example setup there is a qpid router in front of a Artemis
> > broker and a client, which opens a receiver link to qpid (and qpid
> creates
> > a link to Artemis for this address).
> >
> > Initially all works as expected and messages, wich are send to the
> Artemis
> > address are received by the receiver.
> >
> > When the broker is killed, the qpid sends a detach with closed=false (on
> > this I would assume that also a detach with closed=false should be send
> > back from the receiver).
> >
> > If now, the broker is started again, the receiver gets no attach frame
> and
> > does not receive messages. (It gets an attach and receive messages, if it
> > is also restarted.)
> >
> > My expectation was, that qpid would establish the link with the broker
> and
> > send an attach frame to the receiver.
> >
> > Is the expected behavior from the receiver, that after a detach with
> > closed=false it need to close and try to open until the Broker is
> available
> > again?
>
> It shouldn't have to close, but it will need to try to re-attach the link.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>
>

Re: Link handling after detach(close=false)

Posted by Gordon Sim <gs...@redhat.com>.
On 29/01/18 17:28, Marc Pellmann wrote:
> Hi,
> 
> I work on the Eclipse Hono project, where we use the qpid router.
> 
> In a specific situation, I am not sure about the expected behavior and hope
> you can help me out.
> 
> In our default/example setup there is a qpid router in front of a Artemis
> broker and a client, which opens a receiver link to qpid (and qpid creates
> a link to Artemis for this address).
> 
> Initially all works as expected and messages, wich are send to the Artemis
> address are received by the receiver.
> 
> When the broker is killed, the qpid sends a detach with closed=false (on
> this I would assume that also a detach with closed=false should be send
> back from the receiver).
> 
> If now, the broker is started again, the receiver gets no attach frame and
> does not receive messages. (It gets an attach and receive messages, if it
> is also restarted.)
> 
> My expectation was, that qpid would establish the link with the broker and
> send an attach frame to the receiver.
> 
> Is the expected behavior from the receiver, that after a detach with
> closed=false it need to close and try to open until the Broker is available
> again?

It shouldn't have to close, but it will need to try to re-attach the link.

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