diff --git a/include/client/taos.h b/include/client/taos.h index 09327154e6..f75a84baa8 100644 --- a/include/client/taos.h +++ b/include/client/taos.h @@ -319,6 +319,7 @@ DLL_EXPORT int32_t tmq_offset_seek(tmq_t *tmq, const char *pTopicName, int32_t DLL_EXPORT int64_t tmq_position(tmq_t *tmq, const char *pTopicName, int32_t vgId); // The current offset is the offset of the last consumed message + 1 DLL_EXPORT int64_t tmq_committed(tmq_t *tmq, const char *pTopicName, int32_t vgId); +DLL_EXPORT TAOS *tmq_get_connect(tmq_t *tmq); DLL_EXPORT const char *tmq_get_table_name(TAOS_RES *res); DLL_EXPORT tmq_res_t tmq_get_res_type(TAOS_RES *res); DLL_EXPORT const char *tmq_get_topic_name(TAOS_RES *res); diff --git a/source/client/src/clientTmq.c b/source/client/src/clientTmq.c index c9c8a66c7a..6ee5508048 100644 --- a/source/client/src/clientTmq.c +++ b/source/client/src/clientTmq.c @@ -3106,3 +3106,10 @@ int32_t tmq_offset_seek(tmq_t* tmq, const char* pTopicName, int32_t vgId, int64_ return code; } + +TAOS *tmq_get_connect(tmq_t *tmq){ + if (tmq && tmq->pTscObj) { + return (TAOS *)(&(tmq->pTscObj->id)); + } + return NULL; +}