In TIBCO EMS C APIs there are some API whose usage documentation is not very clear.
for example, the documentation for the below APIsays
tibems_status tibemsMsg_GetCorrelationID( tibemsMsg message, const char** value );
Parameters Description
message: Get the type header of this message.
value : Store the type.
What Does the Store mean here? Is new memory allocated for value? How does the memory get freed for value?
By calling tibemsMsg_Destroy() the message is destroyed, but I could still print the correllationID.
If the message is destroyed then how correlationID is still available?
For best performance, this call returns you the address of the correlation ID within that message.
You can copy it if you need it, but should not use it after destroying that message. It might still be visible after destroy BUT it is now part of the freed memory and could be overwritten with other things anytime.
A typical use case might be this to copy the content into an std::string.