Skip to main content
Apache Pulsar provides client libraries in multiple programming languages, allowing you to build applications that produce and consume messages from Pulsar topics.

Available client libraries

Pulsar offers official client libraries for the following languages:

Java

Native Java client with full feature support

Python

Python client for building data pipelines

Go

Go client for high-performance applications

C++

Native C++ client for low-latency use cases

Node.js

JavaScript/TypeScript client for Node.js

.NET/C#

Modern .NET client for C# applications

Client features

All Pulsar client libraries provide:
  • Producer API - Publish messages to topics with sync/async support
  • Consumer API - Subscribe to topics with various subscription types
  • Reader API - Read messages from specific positions
  • Schema support - Built-in serialization with Avro, JSON, Protobuf
  • Authentication - TLS, JWT, OAuth 2.0, and custom auth plugins
  • Compression - LZ4, Zlib, Zstd, and Snappy compression
  • Batching - Automatic message batching for throughput
  • Partitioning - Automatic routing for partitioned topics

Choosing a client library

Java client

The Java client is the most feature-complete implementation and is maintained as part of the main Pulsar repository. Use Java when:
  • Building enterprise applications with JVM
  • Need access to latest Pulsar features
  • Building Pulsar Functions in Java
  • Require maximum compatibility

Python client

The Python client is a C++ binding providing native performance with Python ergonomics. Use Python when:
  • Building data processing pipelines
  • Working with data science frameworks
  • Need rapid development
  • Integrating with ML workflows

Go client

The Go client is a pure Go implementation optimized for cloud-native applications. Use Go when:
  • Building microservices
  • Deploying in Kubernetes
  • Need lightweight containers
  • Require strong concurrency

C++ client

The C++ client provides the lowest latency and highest throughput. Use C++ when:
  • Building low-latency systems
  • Need maximum performance
  • Working in embedded systems
  • Have existing C++ codebases

Node.js client

The Node.js client enables JavaScript/TypeScript applications to use Pulsar. Use Node.js when:
  • Building web applications
  • Using JavaScript ecosystem
  • Need TypeScript support
  • Working with Express/Fastify

.NET client

The .NET client (DotPulsar) is a modern C# implementation for .NET Core and .NET Framework. Use .NET when:
  • Building .NET applications
  • Using C# or F#
  • Need Windows support
  • Working with Azure

Installation

Each client library has its own installation method:
<dependency>
  <groupId>org.apache.pulsar</groupId>
  <artifactId>pulsar-client</artifactId>
  <version>4.2.0</version>
</dependency>

Basic usage

All client libraries follow a similar pattern:
1

Create a client

Connect to the Pulsar cluster
2

Create a producer or consumer

Build a producer to publish or consumer to subscribe
3

Send or receive messages

Publish or consume messages
4

Close resources

Close the client when done

Authentication

All clients support multiple authentication methods:
  • TLS Authentication - Client certificates
  • Token Authentication - JWT tokens
  • OAuth 2.0 - OAuth authentication flow
  • Athenz - Yahoo’s Athenz authorization
  • SASL/Kerberos - Enterprise authentication

Client repositories

The client libraries are maintained in separate repositories:

Next steps

Java client

Get started with the Java client

Producer API

Learn about producers and consumers

Schema support

Understand Pulsar schemas

Authentication

Configure client authentication

Build docs developers (and LLMs) love