Carrier Organization
Backend & Runtime / Knowledge library
Apache Pulsar
persistent topics subscriptions and multi-tenant messaging
Why learn Apache Pulsar?
Useful for varied queue and streaming patterns. Subscription mode, ordering, and acknowledgment behavior should be matched to each consumer.
Where it came from
Apache Pulsar supports distributed messaging through persistent topics and configurable subscriptions. Its architecture separates serving messages from durable storage components.
Build your understanding
Work through these exercises in order. Try the task before opening a reference.
- Publish records to a test topic.
- Create consumers with a chosen subscription type.
- Observe acknowledgment and redelivery.
- Test message ordering within the intended scope.
- Document retention and replay requirements.
Documentation and sources
- Official project documentation (pulsar.apache.org)
Catalog research notes
- Research snapshot: September 9, 2026. This entry summarizes the linked primary documentation; it does not assert a latest release version.
Connect the ideas
Alternatives
Explore next
Real World Example
Multi-Tenant Logistics Data Isolation
A global logistics platform providing supply chain tracking services to multiple independent shipping carriers.
The business problem
The platform struggles with data leakage and resource contention when multiple carriers share the same messaging infrastructure, leading to unauthorized access risks and noisy neighbor performance degradation.
How this topic solves it
Utilizing Apache Pulsar's multi-tenancy architecture, the platform assigns each carrier to a distinct tenant and namespace. Persistent topics ensure that message delivery is guaranteed via BookKeeper, while subscription types allow carriers to choose between exclusive processing for strict ordering or shared processing for parallel scaling.
- Create a dedicated tenant for each logistics carrier to enforce administrative isolation.
- Define namespaces within each tenant to manage topic policies and storage quotas.
- Configure persistent topics within the namespace to ensure messages are stored on disk via BookKeeper.
- Assign specific subscription types to consumer applications based on whether they require strict message ordering or high-throughput parallel processing.
This diagram illustrates the hierarchical relationship between tenants, namespaces, and topics.
Logical grouping of topics
Message storage unit
Consumer access point
- Tenant → owns (1:N) → Namespace
- Namespace → contains (1:N) → Persistent Topic
- Persistent Topic → has (1:N) → Subscription
Implementation example
This code demonstrates connecting to a persistent topic within a specific tenant and namespace, using a shared subscription to distribute load across multiple consumer instances.
Consumer<byte[]> consumer = client.newConsumer()
.topic("persistent://carrier-a/logistics-ns/tracking-updates")
.subscriptionName("order-processor")
.subscriptionType(SubscriptionType.Shared) // Allows parallel processing
.subscribe();Expected business outcome
Each carrier operates within a secure, isolated environment where their messaging traffic is logically separated from others, ensuring data privacy and predictable resource allocation.
Limitations and checks
Persistent topics incur storage overhead on BookKeeper nodes. To check if storage limits are reached, monitor the backlog size and storage usage metrics per namespace to prevent disk exhaustion.