Open topic with navigation

TIBCO Rendezvous® 8.7.0

# TibrvMsg()

Constructor

## Declaration

    TibrvMsg()
    TibrvMsg(TibrvMsg msg) throws TibrvException
    TibrvMsg(byte[] bytes) throws TibrvException

## Purpose

Create a message object.

## Remarks

None of these constructors place address information on the new message object.

This class has no `destroy()` method. Instead, the Java garbage collector reclaims storage automatically. To actively manage message storage, see TibrvMsg.dispose().

To use an inbound message outside of its callback, you can use the copy constructor to detach (that is, copy) a message—for example, to process a message in a different thread. (If your program detaches a message, then you must also ensure that no references to the copy remain; such references could interfere with garbage collection. Furthermore, when using the TIBCO Rendezvous JNI preferred library, we recommend that programs call TibrvMsg.dispose() to explicitly release the copy’s storage within the native C environment.)

Parameter | Description
`msg` | Create an independent copy of this message.
`bytes` | Create a message with fields populated from this byte array. For example, programs can create such byte arrays from messages using the method TibrvMsg.getAsBytes(), and store them in files; after reading them from such files, programs can reconstruct a message from its byte array.

## Method Forms

With no argument, create an empty message (with no fields).

With a TibrvMsg argument, create an independent copy of that message, copying all its fields (field values are also independent copies).

With a byte array argument, create a message with fields populated from the byte array.

## See Also

TibrvMsg.dispose()

TibrvMsg.getAsBytes()

TibrvMsgCallback.onMsg()

TibrvVectorCallback.onMsgs()

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.