Skip to content

Connection handshake failed: org.apache.pulsar.client.api.PulsarClientException: Connection already closed #9040

Description

@balakrishna222111

I had apache pulsar cluster in azure .
Now i would like to connect to remote cluster from my local mahcine using Proxy

In **proxy.conf** file i set up configuration like this

--- Broker Discovery ---

zookeeperServers=xx.xx.xx.xx:2181,xx.xx.xx.xx:0:2181,xx.xx.xx.xx::2181

configurationStoreServers=xx.xx.xx.xx::2181,xx.xx.xx.xx::2181,xx.xx.xx.xx:xx:2181

brokerServiceURL=pulsar://xx.xx.xx.xx::6650,xx.xx.xx.xx::6650,xx.xx.xx.xx::6650
brokerServiceURLTLS=
brokerWebServiceURL=http://xx.xx.xx.xx::8080,xx.xx.xx.xx::8080,xx.xx.xx.xx::8080

---------------------------------------------------------------------------------------------

In client.conf file i set up configuration like this

webServiceUrl=http://xx.xx.xx.xx:8080,xx.xx.xx.xx:8080,xx.xx.xx.xx:8080

brokerServiceUrl=pulsar://xx.xx.xx.xx:8080,xx.xx.xx.xx:8080,xx.xx.xx.xx:8080

---------------------------------------------------------------------------------------------

After that i ran this command u can see the below logs even proxy ran well

**bin/pulsar proxy **

13:55:44.775 [main] INFO org.eclipse.jetty.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler@6bd16207{/lookup,null,AVAILABLE}
13:55:44.788 [main] INFO org.eclipse.jetty.server.AbstractConnector - Started ServerConnector@3a0807b7{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
13:55:44.788 [main] INFO org.eclipse.jetty.server.Server - Started @16022ms
13:55:44.789 [main] INFO org.apache.pulsar.proxy.server.WebServer - Server started at end point http://0.0.0.0:8080

In another terminal

bin/pulsar-client consume my-topic -s "first-subscription"

Then i faced below error

Connection handshake failed: org.apache.pulsar.client.api.PulsarClientException: Connection already closed
13:59:44.816 [pulsar-external-listener-3-1] WARN org.apache.pulsar.client.impl.PulsarClientImpl - [topic: persistent://public/default/my-topic] Could not get connection while getPartitionedTopicMetadata -- Will try again in 2960 ms
13:59:45.079 [pulsar-client-io-1-1] INFO org.apache.pulsar.client.impl.Connect

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/staletype/enhancementThe enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions