Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion source/client/src/clientTmq.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "tdatablock.h"
#include "tdef.h"
#include "tglobal.h"
#include "tmsg.h"
#include "tqueue.h"
#include "tref.h"
#include "ttimer.h"
Expand Down Expand Up @@ -1841,7 +1842,7 @@ tmq_t* tmq_consumer_new(tmq_conf_t* conf, char* errstr, int32_t errstrLen) {
}

// init connection
code = taos_connect_internal(conf->ip, user, pass, NULL, NULL, conf->port, CONN_TYPE__TMQ, &pTmq->pTscObj);
code = taos_connect_internal(conf->ip, user, pass, NULL, NULL, conf->port, CONN_TYPE__QUERY, &pTmq->pTscObj);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve maintainability, it's helpful to add a comment explaining why CONN_TYPE__QUERY is used instead of CONN_TYPE__TMQ. This clarifies that the change is a deliberate fix for a heartbeat decoding issue and prevents accidental reversions in the future.

  // Use CONN_TYPE__QUERY to ensure compatibility with server heartbeat responses.
  // Using CONN_TYPE__TMQ can lead to decoding errors.
  code = taos_connect_internal(conf->ip, user, pass, NULL, NULL, conf->port, CONN_TYPE__QUERY, &pTmq->pTscObj);

if (code) {
terrno = code;
tqErrorC("consumer:0x%" PRIx64 " setup failed since %s, groupId:%s", pTmq->consumerId, terrstr(), pTmq->groupId);
Expand Down
Loading