diff --git a/include/client/taos.h b/include/client/taos.h index dac8e61542..59b2d7ec03 100644 --- a/include/client/taos.h +++ b/include/client/taos.h @@ -313,6 +313,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 6241c089e9..e97b92148b 100644 --- a/source/client/src/clientTmq.c +++ b/source/client/src/clientTmq.c @@ -3106,3 +3106,11 @@ 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) { + int64_t *rid = taosMemoryCalloc(1, sizeof(int64_t)); + return (TAOS *)(&(tmq->pTscObj->id)); + } + return NULL; +}