Open topic with navigation

TIBCO Rendezvous® 8.7.0

# Get Nested Message

Convenience Method

## Declaration

    TibrvStatus getMsg(
        const char*    fieldName,
        TibrvMsg&      subMessage,
        tibrv_u16      fieldId=0);

## Purpose

Get the value of a field as a Rendezvous message.

## Remarks

Since it is not possible to convert any other datatype to a message, the field must already contain a message. Otherwise, the method returns TIBRV_CONVERSION_FAILED.

Pointer data extracted from the field remain valid until the message is destroyed; that is, even removing the field or updating the field’s value does not invalidate pointer data.

After extracting a submessage, a program can detach it. A detached submessage remains valid and unchanged even after the parent message is destroyed. The program must explicitly destroy the detached submessage.

This method produces values that are modifiable snapshots of the field data. Programs may modify the resulting submessage by adding, removing or updating fields. However, these modifications do not change the field in the original parent message; instead, they force Rendezvous software to make a copy of the field (see Rendezvous Protects the Message from Changes to Submessage Snapshots).

Parameter | Description
`fieldName` | Get a field with this name.
`subMessage` | The program supplies a variable in this parameter, and the method stores the submessage in that variable.
`fieldId` | Get the field with this identifier. Zero is a special value that signifies no field identifier. All non-zero field identifiers must be unique within each message.

## See Also

Validity of Data Extracted From Message Fields

Field Names and Field Identifiers

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO Rendezvous®

Copyright © 1997-2023. Cloud Software Group, Inc. All Rights Reserved.