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
Work with go gin error #1160
Comments
Hi @darrkz , can you log before producing the topic name? it might be because topic string is empty |
@milindl that's OK, I found I miss a var setting outer function main, and use := redefined it in main, so it could not user in other where. |
Alright @darrkz thanks for the update . Would be be interested in making a PR to improve the messaging around the error? I'm not certain how the error was solved so it might be useful to others in the future. |
@milindl Just my mistake, and not something wrong about confluent-kafka-go... The pr I will make it later... |
Description
I use confluent-kafka-go with github.com/gin-gonic/gin web server
all code logic is :
get message info from http get
convert it to json string
write the json string to kafka using confluent-kafka-go asyncProducer
code like this
when I access the web server , it retuen http 500 and return error
if I add os.Exit(0) before run go-gin, no message was writen to kafka
if I add os.Exit(0) before run go-gin and sleep for a while , about 10 second, then the messages used to test can write to kafka correctly
if I remove the os.Exit(0) , and the gin web server start ok , but when I access the server with http get method, it returns http 500
So I don't konw why, and how to fix this
How to reproduce
Checklist
Please provide the following information:
LibraryVersion()
):v2.3.0
3.6.1
ConfigMap{...}
&map[acks:1 bootstrap.servers:192.168.11.60:9092,192.168.11.61:9092,192.168.11.62:9092 debug:msg delivery.report.only.error:false linger.ms:500 message.max.bytes:1000000 retries:2147482647 retry.backoff.ms:1000 security.protocol
:plaintext sticky.partitioning.linger.ms:1000]
WSL: kali 2023.4
"debug": ".."
as necessary)The text was updated successfully, but these errors were encountered: