Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The timestamp of kafka is -1 #158

Open
junchuLF opened this issue Jul 31, 2023 · 7 comments
Open

The timestamp of kafka is -1 #158

junchuLF opened this issue Jul 31, 2023 · 7 comments

Comments

@junchuLF
Copy link

lua_resty_kafka Version is 0.22 .
api_version = 2
The message timestamp received by Kafka is -1

image
@vantsiforov
Copy link

in producer.lua in line 32 i've remove "not"

when it's
if self.api_version then
version = self.api_version.
end

now it take api_version parama from produer init, and using message format with timestamp. not sure of other unctionality in this case

@DG-Wangtao
Copy link
Contributor

@doujiang24 Hi, I fixed a same issue in #160, but a new version needs to be released.

@doujiang24
Copy link
Owner

@junchuLF could you please try the 0.23 release? thanks~

@petruxa77799
Copy link

Sorry, but is there any update on this? Timestamp is still -1.

@DG-Wangtao
Copy link
Contributor

@petruxa77799 Hi, which version is using in your code ?

I have two suggestions here:

  1. check version in your .rockespec: "lua-resty-kafka >= 0.23"
  2. set default version in your lua code:
local kafka_producer = require "resty.kafka.producer"
local producer_config = {
  ... ...
  api_version = 2,
}
return kafka_producer:new(broker_list, producer_config, cluster_name)

@bfyxzls
Copy link

bfyxzls commented Sep 10, 2024

方法2中

local kafka_producer = require "resty.kafka.producer"
local producer_config = {
  ... ...
  api_version = 2,
}
return kafka_producer:new(broker_list, producer_config, cluster_name)

这个代码还是没有解决,我的lua-resty-kafka是0.22的版本
方法1,因为我是apisix的helm方式,不知道怎么升级这个resty.kafka.producer

@DG-Wangtao
Copy link
Contributor

apisix has already upgrade lua-resty-kafka here Update lua-resty-kafka to 0.23-0, but a new version is needed to be released.

You can ask apisix community to release a new version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants