You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by ali hadi <al...@gmail.com> on 2018/09/28 09:49:46 UTC

Send timeout in proton C++

Hello,



Our messaging topology uses a dispatch-router in front of many Java brokers.

In the case where all our brokers are down, we want to throw an exception
to the producer after a timeout. This is not possible with the idle-timeout
parameter since the producer is connected to the dispatch router which is
still responding.

Is there an equivalent to the JMS send timeout parameter or a way to not
let the producer hanging forever in proton C++?



Regards,

Ali

Re: Send timeout in proton C++

Posted by Gordon Sim <gs...@redhat.com>.
On 28/09/18 16:26, Gordon Sim wrote:
> On 28/09/18 16:13, HADI Ali wrote:
>> The action I want to take is to stop the send.
> 
> Ah, that I'm afraid cannot be done.
> 
>> Is there a way other than stopping the container to do this ?
> 
> Even stopping the container won't actually 'stop' the send, it will just 
> prevent processing of any acknowledgement if it does arrive.

That last clause is a little clumsily worded. What I mean is that if the 
transfer has already been sent and you are just waiting for the ack, 
then stopping the container will just stop waiting for the ack.


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


Re: Send timeout in proton C++

Posted by Gordon Sim <gs...@redhat.com>.
On 28/09/18 16:13, HADI Ali wrote:
> The action I want to take is to stop the send.

Ah, that I'm afraid cannot be done.

> Is there a way other than stopping the container to do this ?

Even stopping the container won't actually 'stop' the send, it will just 
prevent processing of any acknowledgement if it does arrive.

(You *can* set a TTL on the message, but once transferred you can't 
cancel it in anyway; the protocol has no support for that).

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


RE: Send timeout in proton C++

Posted by HADI Ali <Al...@murex.com>.
The action I want to take is to stop the send. Is there a way other than stopping the container to do this ? For example, during the receive, we are using the drain function after the timeout to stop receiving.

Thanks,
Ali

-----Original Message-----
From: Gordon Sim <gs...@redhat.com> 
Sent: vendredi 28 septembre 2018 13:00
To: users@qpid.apache.org
Subject: Re: Send timeout in proton C++

On 28/09/18 10:49, ali hadi wrote:
> Hello,
> 
> 
> 
> Our messaging topology uses a dispatch-router in front of many Java brokers.
> 
> In the case where all our brokers are down, we want to throw an 
> exception to the producer after a timeout. This is not possible with 
> the idle-timeout parameter since the producer is connected to the 
> dispatch router which is still responding.
> 
> Is there an equivalent to the JMS send timeout parameter or a way to 
> not let the producer hanging forever in proton C++?

No, but you can implement a timeout like that using the schedule() method on the container. On sending a message, schedule a check on the return tracker after the appropriate timeout. If when that fire the delivery the tracker refers to has not been settled, you can take whatever action needed to handle the timeout.

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

*******************************

This e-mail contains information for the intended recipient only. It may contain proprietary material or confidential information. If you are not the intended recipient you are not authorised to distribute, copy or use this e-mail or any attachment to it. Murex cannot guarantee that it is virus free and accepts no responsibility for any loss or damage arising from its use. If you have received this e-mail in error please notify immediately the sender and delete the original email received, any attachments and all copies from your system.

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


Re: Send timeout in proton C++

Posted by Gordon Sim <gs...@redhat.com>.
On 28/09/18 10:49, ali hadi wrote:
> Hello,
> 
> 
> 
> Our messaging topology uses a dispatch-router in front of many Java brokers.
> 
> In the case where all our brokers are down, we want to throw an exception
> to the producer after a timeout. This is not possible with the idle-timeout
> parameter since the producer is connected to the dispatch router which is
> still responding.
> 
> Is there an equivalent to the JMS send timeout parameter or a way to not
> let the producer hanging forever in proton C++?

No, but you can implement a timeout like that using the schedule() 
method on the container. On sending a message, schedule a check on the 
return tracker after the appropriate timeout. If when that fire the 
delivery the tracker refers to has not been settled, you can take 
whatever action needed to handle the timeout.

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