TibrvCmMsg::getSequence()

Method

Declaration

static TibrvStatus getSequence(
    TibrvMsg& msg,
    tibrv_u64& sequenceNumber);

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

msg

Extract the sequence number from this message.

sequenceNumber

The program supplies a variable. The method stores the sequence number in that variable.

Status

This method returns a status code that discriminates between certified messages (with 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() returns the status code TIBRV_OK and 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 TibrvCmMsgCallback::onCmMsg() method returns the status code TIBRV_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 TIBCO Rendezvous Concepts.)

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 the status code TIBRV_NOT_FOUND.

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).

See Also

TibrvCmTransport::send()