trq_get_by_key()

trq_get_by_key()#

trq_get_by_key() retrieves a message from the queue iterator using its unique key.

Prototype

q_msg trq_get_by_key(
    tr_queue   trq,
    const char *key
);

Parameters

Key

Type

Description

trq

tr_queue

The queue instance from which to retrieve the message.

key

const char *

The unique key identifying the message to retrieve.


Return Value

Returns a q_msg handle to the retrieved message, or NULL if no message with the given key exists.

Notes

The returned q_msg should be properly managed to avoid memory leaks. Consider using trq_unload_msg() when the message is no longer needed.

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples