qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Sim <g...@redhat.com>
Subject Re: getTtl() behaviour (C++ messaging API)
Date Tue, 19 Jan 2016 16:01:36 GMT
On 01/19/2016 02:19 PM, Toralf Lund wrote:
> Hi,
>
> I have some questions about the value from
> qpid::messaging::Message::getTtl() on received messages; based on
> testing, I've concluded that
>
>   1.  The value returned represents the time that remains of the
> time-to-live specified by the sender.
>   2.  If no TTL was set, the value is
> qpid::messaging::Duration::IMMEDIATE, which is equivalent to 0.

That is a bit unfortunate.

> Is this correct? If it is, when exactly does the count-down occur? And
> when does the clock stop, so as to speak? When I call fetch(), or when
> the message is pre-fetched by the receiver, or at some other point?

The value reported for received messages is that value that was written 
to the wire by the peer (e.g. the broker). The receiving client does not 
reduce this value in anyway after the message has been decoded.

> Also, can I always assume there is no real time-to-live if
> qpid::messaging::Duration::IMMEDIATE is returned, or could I also get
> that value because the message was about to expire when it was fetched?

If the ttl was 0 at the point the peer was encoding it, I would 
generally expect the message not to be sent at all. Therefore I would 
not expect a message to be read from the wire with ttl=0 and so at 
present I think you can treat IMMEDIATE as implying no ttl (as ugly as 
that is).


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


Mime
View raw message