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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to