tree: f3829d99343abbaa84b680a7cd539bc2d7292308 [path history] [tgz]
  1. pom.xml
  2. readme.md
  3. src/
pulsar-discovery-service/readme.md

Discovery service

It keeps list of active available brokers and redirects all incoming requests to one of the broker in round-robin manner.

Deployment

Discovery service module contains embedded jetty server and service can be started on it using following script:

mvn exec:java -Dexec.mainClass=org.apache.pulsar.discovery.service.server.DiscoveryServiceStarter -Dexec.args=$CONF_FILE

CONF_FILE should have following property

zookeeperServers=<zookeeper-connect-string(comma-separated)>
webServicePort=<port-to-start-server-on>

TEST

After starting server:

Hit any broker service url by providing discovery service domain.

Instead of calling individual broker url:

http://broker-1:8080/admin/namespaces/{property}

call discovery service which redirects to one of the broker:

http://pulsar-discovery-service:8080/admin/namespaces/{property}

Curl Example

curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://pulsar-discovery:8080/admin/namespaces/{property} -L