mirror of
https://github.com/sogou/workflow.git
synced 2026-10-26 09:39:24 +08:00
set kafka correlation id
This commit is contained in:
@@ -1656,6 +1656,7 @@ KafkaMessage::KafkaMessage()
|
||||
kafka_parser_init(this->parser);
|
||||
this->stream = new EncodeStream;
|
||||
this->api_type = Kafka_Unknown;
|
||||
this->correlation_id = 0;
|
||||
this->cur_size = 0;
|
||||
}
|
||||
|
||||
@@ -1799,7 +1800,7 @@ int KafkaMessage::encode_head()
|
||||
append_i32(this->headbuf, 0);
|
||||
append_i16(this->headbuf, this->api_type);
|
||||
append_i16(this->headbuf, this->api_version);
|
||||
append_i32(this->headbuf, 0);
|
||||
append_i32(this->headbuf, this->correlation_id);
|
||||
append_string(this->headbuf, this->config.get_client_id());
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -60,6 +60,9 @@ public:
|
||||
void set_api_version(int ver) { this->api_version = ver; }
|
||||
int get_api_version() const { return this->api_version; }
|
||||
|
||||
void set_correlation_id(int id) { this->correlation_id = id; }
|
||||
int get_correlation_id() const { return this->correlation_id; }
|
||||
|
||||
void set_config(const KafkaConfig& conf)
|
||||
{
|
||||
this->config = conf;
|
||||
@@ -197,6 +200,7 @@ protected:
|
||||
|
||||
int api_type;
|
||||
int api_version;
|
||||
int correlation_id;
|
||||
int message_version;
|
||||
|
||||
std::map<int, int> api_mver_map;
|
||||
|
||||
Reference in New Issue
Block a user