You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "mrtkp9993 (via GitHub)" <gi...@apache.org> on 2023/07/28 11:41:37 UTC
[GitHub] [pulsar-client-go] mrtkp9993 opened a new issue, #1072: Client tries to connect local broker when trying connect to remote broker
mrtkp9993 opened a new issue, #1072:
URL: https://github.com/apache/pulsar-client-go/issues/1072
#### Expected behavior
Connect succesfully to remote broker
#### Actual behavior
After connecting remote broker, client also tries to connect to localhost (which has no pulsar broker on local.)
#### Steps to reproduce
1. Try to connect broker
```go
pulsarClient, err := pulsar.NewClient(
pulsar.ClientOptions{
URL: "pulsar://xxx.xxx.xxx.xxx:6650",
OperationTimeout: 30 * time.Second,
ConnectionTimeout: 15 * time.Second,
},
)
if err != nil {
log.Fatalln("couldnt init pulsar: ", err)
}
defer pulsarClient.Close()
```
2. Observe error
```
PS C:\Users\user\Desktop\itch_go> go run .\main.go
time="2023-07-28T14:31:59+03:00" level=info msg="Connecting to broker" remote_addr="pulsar://xxx.xxx.xxx.xxx:6650"
time="2023-07-28T14:31:59+03:00" level=info msg="TCP connection established" local_addr="yyy.yyy.yyy.yyy:50332" remote_addr="pulsar://17
8.244.233.211:6650"
time="2023-07-28T14:31:59+03:00" level=info msg="Connection is ready" local_addr="yyy.yyy.yyy.yyy:50332" remote_addr="pulsar://xxx.xxx.xxx.xxx:6650"
time="2023-07-28T14:31:59+03:00" level=info msg="Connecting to broker" remote_addr="pulsar://127.0.0.1:6650"
time="2023-07-28T14:32:00+03:00" level=warning msg="Failed to connect to broker." error="dial tcp 127.0.0.1:6650: connectex: No conne
ction could be made because the target machine actively refused it." remote_addr="pulsar://127.0.0.1:6650"
time="2023-07-28T14:32:00+03:00" level=error msg="Failed to create producer at send PRODUCER request" error="connection error" topic=
"persistent://public/default/message"
time="2023-07-28T14:32:00+03:00" level=error msg="Failed to create producer at newPartitionProducer" error="connection error" topic="
persistent://public/default/message"
2023/07/28 14:32:00 connection error
exit status 1
```
#### System configuration
**Pulsar version**: apachepulsar/pulsar:latest docker image
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar-client-go] mrtkp9993 commented on issue #1072: Client tries to connect local broker when trying connect to remote broker
Posted by "mrtkp9993 (via GitHub)" <gi...@apache.org>.
mrtkp9993 commented on issue #1072:
URL: https://github.com/apache/pulsar-client-go/issues/1072#issuecomment-1655553530
I changed following line in docker compose file to `xxx.xxx.xxx.xxx` ip address:
`advertisedListeners=external:pulsar://xxx.xxx.xxx.xxx:6650`
and problem solved.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar-client-go] mrtkp9993 closed issue #1072: Client tries to connect local broker when trying connect to remote broker
Posted by "mrtkp9993 (via GitHub)" <gi...@apache.org>.
mrtkp9993 closed issue #1072: Client tries to connect local broker when trying connect to remote broker
URL: https://github.com/apache/pulsar-client-go/issues/1072
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org