Send timeout in proton C++

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Send timeout in proton C++

ali hadi
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
Reply | Threaded
Open this post in threaded view
|

Re: Send timeout in proton C++

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

Reply | Threaded
Open this post in threaded view
|

RE: Send timeout in proton C++

HADI Ali
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 <[hidden email]>
Sent: vendredi 28 septembre 2018 13:00
To: [hidden email]
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: [hidden email] For additional commands, e-mail: [hidden email]

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

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

Reply | Threaded
Open this post in threaded view
|

Re: Send timeout in proton C++

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

Reply | Threaded
Open this post in threaded view
|

Re: Send timeout in proton C++

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