Skip to main content

Pulsar Java client

You can use a Pulsar Java client to create Pulsar producers, consumers, and readers in Java and perform administrative tasks. All the methods in Java clients are thread-safe. The current Java client version is @pulsar:version@.

Get started

  1. Set up Java client library
  2. Initialize a Java client
  3. Use a Java client

What's next?

Reference doc

API reference

The following table outlines the API packages and reference docs for Pulsar Java clients.

PackageDescriptionMaven Artifact
org.apache.pulsar.client.apiJava client API.
See Client API overview for more reference.
org.apache.pulsar:pulsar-client:@pulsar:version@
org.apache.pulsar.client.adminJava admin API.
See Admin API overview for more reference.
org.apache.pulsar:pulsar-client-admin:@pulsar:version@
org.apache.pulsar.client.allInclude both pulsar-client and pulsar-client-admin.
Both pulsar-client and pulsar-client-admin are independently shaded packages. Consequently, the applications using both pulsar-client and pulsar-client-admin have redundant shaded classes. It would be troublesome if you introduce new dependencies but forget to update shading rules.
In this case, you can use pulsar-client-all, which shades dependencies only one time and reduces the size of dependencies.
org.apache.pulsar:pulsar-client-all:@pulsar:version@

More reference