qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Toralf Lund <toralf.l...@pgs.com>
Subject Re: getTtl() behaviour (C++ messaging API)
Date Wed, 20 Jan 2016 12:29:03 GMT
On 19/01/16 17:01, Gordon Sim wrote:
> 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.
Yes. I sort of expected qpid::messaging::Duration::FOREVER...
>> 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.
So, in other words, the value relates to the time Receiver::fetch() was
called on a receiver with capacity 0, and the point where the receiver
got the message "in the background" if capacity is >0?

How exactly does the prefetch work, by the way? Will the client still
ask for messages individually, or does it tell the broker in advance
that it's prepared to receive a certain number of messages?

>> 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).
Fair enough. I can work with that.


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

      Toralf Lund
Senior Software Engineer
Imaging & Engineering | Geoscience & Engineering

Telephone: +47 67 52 64 00
Direct: +47 67 51 57 78
VOIP: 74715778
Mobile: +47 91 31 66 91
Email: toralf.lund@pgs.com<mailto:Toralf.Lund@pgs.com>

A Clearer Image | www.pgs.com<http://www.pgs.com>


Address: Lilleakerveien 4C, 0283 Oslo, Norway
Postal Address: P.O.Box 251 Lilleaker, 0216 Oslo, Norway

This e-mail, including any attachments and response string, may contain proprietary information
which is confidential and may be legally privileged. It is for the intended recipient only.
If you are not the intended recipient or transmission error has misdirected this e-mail, please
notify the author by return e-mail and delete this message and any attachment immediately.
If you are not the intended recipient you must not use, disclose, distribute, forward, copy,
print or rely on this e-mail in any way except as permitted by the author.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message