How streamnative/pulsar-rs works
pulsar-rs is an asynchronous Rust client for Apache Pulsar. Its principal workflow is to build a client, establish and maintain broker connections, then publish messages or subscribe, receive, and acknowledge them; the library also exposes readers and administrative operations. The graph preserves documented connection, authentication, TLS, retry, batching, compression, multi-topic, and executor capabilities. Some implementation links are based on SOURCE INDEX references or README descriptions rather than complete excerpts, so uncertain links are omitted or marked unverified.
Main entry points: client.rs Pulsar Client · producer.rs Producer · connection_manager.rs Connection Manager · mod.rs Consumer
Components 20
Client API
- Pulsar Client
src/client.rs - Admin API
src/admin.rs
Messaging
- Producer
src/producer.rs - Consumer
src/consumer/mod.rs - Consumer Builder
src/consumer/builder.rs - Consumer Engine
src/consumer/engine.rs - Multi-topic Consumer
src/consumer/multi.rs - Reader
src/reader.rs - Message Framing
src/message.rs
Transport
- Connection Manager
src/connection_manager.rs - Broker Connection
src/connection.rs - Service Discovery
src/service_discovery.rs
Runtime Support
- Authentication
src/authentication.rs - OAuth2 Auth
src/authentication/oauth2.rs - Partition Routing
src/routing_policy.rs - Compression
src/compression.rs - Async Executor
src/executor.rs - Retry Operations
src/retry_op.rs
Other components
- Application
- Pulsar Broker
Connections 21
- Application → Pulsar Client: builds
README.md - Pulsar Client → Consumer Builder: creates builder
src/client.rs - Consumer Builder → Consumer: builds
src/consumer/mod.rs - Pulsar Client → Admin API: exposes
src/client.rs - Application → Producer: publishes with
README.md - Producer → Partition Routing: routes partitions
src/producer.rs - Producer → Message Framing: encodes messages
src/producer.rs - Application → Consumer: subscribes with
README.md - Consumer → Consumer Engine: receives through
src/consumer/mod.rs - Consumer → Multi-topic Consumer: supports multi-topic
README.md - Consumer Engine → Message Framing: decodes messages
src/consumer/engine.rs - Application → Reader: reads with
README.md - Connection Manager → Broker Connection: creates and manages
src/connection_manager.rs - Broker Connection → Pulsar Broker: exchanges protocol data
- Connection Manager → Authentication: initializes auth
src/connection_manager.rs - OAuth2 Auth → Authentication: implements
src/authentication.rs - Pulsar Client → Connection Manager: uses connections
- Pulsar Client → Service Discovery: resolves broker
- Connection Manager → Async Executor: runs async tasks
src/connection_manager.rs - Pulsar Client → Retry Operations: configures retries
src/client.rs - Producer → Compression: compresses payloads