Initialize Python client

You can instantiate a Client object using just a URL for the target Pulsar cluster like this:

  1. import pulsar
  2. client = pulsar.Client('pulsar://localhost:6650')

Initialize - 图1note

If you run a cluster in standalone mode, the broker is available at the pulsar://localhost:6650 URL by default.