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

Connection problem #728

Closed
conrepcr opened this issue May 10, 2024 · 1 comment
Closed

Connection problem #728

conrepcr opened this issue May 10, 2024 · 1 comment

Comments

@conrepcr
Copy link

conrepcr commented May 10, 2024

Hi,

The example from "Getting started" section is used, with following changes:

seeds := []string{"192.168.2.80:9012"}
cl, err := kgo.NewClient(
kgo.SeedBrokers(seeds...),
kgo.ConsumerGroup("tmp"),
kgo.ConsumeTopics("test"),
)

...

record := &kgo.Record{Topic: "test", Value: []byte("bar")}

....

the rest of the code as in the example

Got error :

2024/05/11 01:10:36 [{ 0 unable to join group session: unable to dial: dial tcp 127.0.0.1:9012: connect: connection refused}]

The server is available on 192.168.2.80:9012, firewall is not active.
The group and topic exist.

go version go1.22.3 linux/amd64

Why is 127.0.0.1 used instead of 192.168.2.80?

If an application running on the same server where kafka is running it works as it should.

@twmb
Copy link
Owner

twmb commented May 23, 2024

Please check your broker settings. It looks like you setup advertised listeners to advertise 127.0.0.1. The seed broker you plugged into franz-go is 192.168.2.80, but the ~first thing franz-go does is issue a metadata request and then use that are actually in the metadata response. So, the broker itself is telling the client to use 127.0.0.1, which is being done because of the advertised listeners setting.

@twmb twmb closed this as completed May 23, 2024
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

2 participants