TibrvCmMsg.getSequence()
Method
Declaration
static final longgetSequence
(
TibrvMsg msg)
throws TibrvException
Purpose
Extract the sequence number from a certified message.
Remarks
Rendezvous certified delivery sending methods automatically generate positive sequence numbers for outbound labeled messages.
In receiving programs, zero is a special value, indicating that an inbound message is not certified.
Parameter |
Description |
|
Extract the sequence number from this message. |
Exception
This method throws an exception to discriminate between certified messages (included in a certified delivery agreement) and other messages.
• | If the message is from a CM sender, and the CM listener is registered for certified delivery with that sender, then TibrvCmMsg.getSequence() yields a valid sequence number. |
• | If the message is from a CM sender, but the listener is not registered for certified delivery, then TibrvCmMsg.getSequence() in the context of a TibrvCmListener’s callback method throws an exception with the status code TibrvStatus.NOT_FOUND. (In any other context, it returns the actual sequence number stored on the message.) |
Notice that the first labeled message that a program receives on a subject might not be certified; that is, the sender has not registered a certified delivery agreement with the listener. If appropriate, the certified delivery library automatically requests that the sender register the listener for certified delivery. (See Discovery and Registration for Certified Delivery in
.)A labeled but uncertified message can also result when the sender explicitly disallows or removes the listener.
• | If the message is not from a CM sender, then TibrvCmMsg.getSequence() (in any context) returns zero. |
Release 5 Interaction
In release 6 (and later) the sequence number is a 64-bit unsigned integer, while in older releases (5 and earlier) it is a 32-bit unsigned integer.
When 32-bit senders overflow the sequence number, behavior is undefined.
When 64-bit senders send sequence numbers greater than 32 bits, 32-bit receivers detect malformed label information, and process the message as an ordinary reliable message (uncertified and unlabeled).