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

Library always connect to 127.0.0.1? #254

Open
KuangyeChen opened this issue Jan 29, 2023 · 4 comments
Open

Library always connect to 127.0.0.1? #254

KuangyeChen opened this issue Jan 29, 2023 · 4 comments

Comments

@KuangyeChen
Copy link

Here's my code

let builder = Pulsar::builder(pulsar_url.clone(), TokioExecutor);
let mut producer = builder
    .build()
    .await?
    .producer()
    .with_topic(topic.clone())
    .with_name(name.clone())
    .build()
    .await?;

And I set log level to info.

2023-01-29T14:39:57.021731Z  INFO pulsar::connection_manager: Connected n°74724553-10f4-4c72-a116-56b2a89fa99e to pulsar://xxxxx.com:6650 in 429ms       
2023-01-29T14:39:58.510769Z  WARN pulsar::connection: retry establish connection on: [Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" })] 
2023-01-29T14:39:58.512297Z ERROR pulsar::connection_manager: connection error, retrying connection to pulsar://127.0.0.1:6650 after 100ms                          
2023-01-29T14:39:58.614264Z  WARN pulsar::connection: retry establish connection on: [Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" })] 

Which connects to localhost even if I set url to a remote host.

@tisonkun
Copy link
Contributor

There's no logic in the library to set different URLs. You can share more info, especially what the URL you configured is.

@tisonkun
Copy link
Contributor

In addition, generally connected logged after retries. So it looks like you have multiple connections.

@tisonkun
Copy link
Contributor

cc @CleverAkanoa since you're working on reconnection recently.

@KuangyeChen
Copy link
Author

There's no logic in the library to set different URLs. You can share more info, especially what the URL you configured is.

The url I used is just "pulsar://xxxxx.com:6650". Than I got errors trying to connect to 127.0.0.1.
When I try on the server running pulsar, this code will work, but there will also be two connection logs.

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