Reliable PubSub vs Valkey & Redis PubSub
Redisson PRO enables Java developers to take full advantage of the speed and reliability of Valkey or Redis while adding a host of new functionality. One of Redisson PRO's standout features is its Reliable PubSub messaging implementation. But since Valkey/Redis has its own PubSub features, you may wonder if Reliable PubSub is any different.
Reliable PubSub is not just a Java wrapper around the PubSub found in the stock Valkey or Redis. Whereas the Valkey/Redis native PubSub is a lightweight mechanism optimized for real-time notifications, where occasional message loss is acceptable, Reliable PubSub is a full-featured enterprise messaging system with many unique features.
Here is a comparison between Reliable PubSub and native Valkey/Redis PubSub to help you decide which is right for your distributed applications.
Quick Feature Comparison
| Valkey/Redis PubSub | Reliable PubSub | |
|---|---|---|
| Delivery Guarantee | At-most-once (fire-and-forget) | At-least-once (with ack) |
| Message Persistence | ||
| Acknowledgment | ||
| Consumer Groups | Subscriptions | |
| Message Replay | ||
| Dead Letter Queue | ||
| Use Case | Real-time notifications, cache invalidation | Reliable messaging, task queues |
| Complexity | Very simple | More complex |
| Latency | Sub-millisecond | Low (<10ms) |
Native PubSub offers simple, at-most-once delivery for real-time alerts. Meanwhile, Reliable PubSub guarantees at-least-once delivery for critical task queues while maintaining a low latency under 10 milliseconds.
Message Delivery
| Valkey/Redis PubSub | Reliable PubSub | |
|---|---|---|
| At-Most-Once Delivery | Default (only option) | Via AUTO ack mode |
| At-Least-Once Delivery | Default | |
| Exactly-Once Delivery | Via deduplication | |
| Message Persistence | Ephemeral | |
| Survive Disconnection | Messages lost | |
| Survive Restart | With AOF/RDB | |
| Delivery Confirmation | Acknowledgment | |
| Redelivery on Failure | Visibility timeout |
Data safety is the most critical difference between the two options. Native PubSub permanently loses messages if subscribers disconnect, while Reliable PubSub securely stores messages and automatically redelivers them until they are explicitly acknowledged.
Consumer Model
| Valkey/Redis PubSub | Reliable PubSub | |
|---|---|---|
| Broadcast (Fan-out) | All subscribers get all messages | Multiple subscriptions |
| Load Balancing | All receive the same message | Within subscription |
| Consumer Groups | Subscriptions | |
| Competing Consumers | ||
| Exclusive Consumer | Via a single consumer | |
| Push Model | ||
| Pull Model | ||
| Subscriber Count |
Native PubSub broadcasts every message to all connected subscribers simultaneously. Reliable PubSub introduces consumer groups to load-balance processing tasks across competing workers.
Message Features
| Valkey/Redis PubSub | Reliable PubSub | |
|---|---|---|
| Message Body | String/binary | Any serializable |
| Message Headers | ||
| Message ID | ||
| Message Timestamp | ||
| Message TTL | Per-message | |
| Message Delay | ||
| Message Priority | 0-9 levels | |
| Message Key/GroupId |
Reliable PubSub enhances the basic Valkey/Redis PubSub with new features like a per-message time-to-live (TTL), delayed delivery, priority levels of 0-9, and distinct message headers for intelligent routing.
Acknowledgment & Error Handling
| Valkey/Redis PubSub | Reliable PubSub | |
|---|---|---|
| Acknowledgment | ||
| Negative Acknowledgment | Failed/rejected | |
| Visibility Timeout | ||
| Dead Letter Queue | ||
| Delivery Limit | ||
| Retry with Delay | ||
| Delivery Count Tracking |
Native PubSub lacks any form of error handling, whereas Reliable PubSub supports visibility timeouts, automatic retries, and a Dead Letter Queue (DLQ) for routing messages that fail persistently.
Offset & Replay
| Valkey/Redis PubSub | Reliable PubSub | |
|---|---|---|
| Message Replay | Messages not stored | |
| Seek to Position | ||
| Seek to Timestamp | ||
| Seek to Earliest | ||
| Seek to Latest | ||
| Per-Subscription Offset | ||
| Message History | Within retention |
Because messages in the native Valkey/Redis PubSub leave no history, you need Reliable PubSub to seek specific positions, replay past events, or allow offline subscribers to catch up.
Retention & Storage
| Valkey/Redis PubSub | Reliable PubSub | |
|---|---|---|
| Message Retention | Instant delivery only | |
| Time-Based Retention | ||
| Size-Based Retention | ||
| Retention Modes | 3 modes | |
| Backlog Management | maxSize |
Reliable PubSub provides three configurable retention modes to safely manage message backlogs based on time limits or size limits. The native Valkey/Redis PubSub lacks any comparable feature.
Durability & Replication
| Valkey/Redis PubSub | Reliable PubSub | |
|---|---|---|
| Persistence | Via Redis AOF/RDB | |
| Replication | Broadcast only (not durable) | |
| Sync Replication | Per-operation modes | |
| Survive Failover | In-flight messages lost |
Reliable PubSub ensures in-flight messages survive system failovers via Redis AOF/RDB persistence mechanisms and grants developers granular, per-operation synchronous replication controls.
Scalability
| Valkey/Redis PubSub | Reliable PubSub | |
|---|---|---|
| Sharding | Sharded topics |
Operations & Monitoring
| Valkey/Redis PubSub | Reliable PubSub | |
|---|---|---|
| Subscriber Count | ||
| Consumer Statistics | Per-consumer | |
| Message Statistics | ||
| Event Listeners | ||
| Operation Control | Pause/resume |
Reliable PubSub improves native channel tracking by providing per-consumer statistics and event listeners.
When to Use Valkey/Redis or Reliable PubSub
The native PubSub will work fine in scenarios where a missed message won't cause a critical business failure. Suitable use cases include pushing metrics to live dashboards, updating a user's presence during a chat session, or broadcasting cache invalidation signals across a distributed system. In all of these situations, the lightweight native broadcast model works well.
When any amount of message loss is unacceptable, you need Reliable PubSub. Use cases like order processing, payment notifications, background job queues, and webhook deliveries need guardrails when subscribers might temporarily disconnect, and Reliable PubSub provides them.
If your distributed app requires horizontal load balancing across multiple workers, Reliable PubSub provides these features, whereas the native implementation does not. See how Reliable PubSub compares to Apache Pulsar for these workloads
Features Unique to Reliable PubSub
Ultimately, Reliable PubSub is simply more feature-rich than the native Valkey/Redis version. It adds message persistence, ensuring that critical data safely survives unexpected disconnections and system restarts. Another unique Reliable PubSub feature is its consumer groups, which allow applications to efficiently load-balance work across multiple competing consumers instead of relying on the native PubSub's broadcast-only fan-out model.
Reliable PubSub also offers enterprise-grade messaging controls, including the automatic routing of failed tasks to a DLQ for safe analysis. Developers can schedule delayed deliveries, assign priority levels for urgent tasks, set per-message TTLs for auto-expiration, and easily seek and replay historical messages.
And because Reliable PubSub supports both push and pull consumer models, applications gain absolute control over their processing rates and backpressure handling. These and other features are non-existent with the stock Valkey/Redis PubSub.
Reliable PubSub vs Valkey & Redis PubSub: Which One Is For You?
The native Valkey/Redis PubSub model is blazing fast and includes an ephemeral broadcast mechanism perfect for live updates. However, developers who need the persistence, intelligent routing, and robust error handling required for enterprise applications should use Redisson PRO's Reliable PubSub.
In addition, Valkey/Redis lacks native Java support, which is another reason development teams need Redisson PRO. Its familiar Java classes and methods make implementing features like Reliable PubSub intuitive and easy.
To learn more, read this guide to Reliable PubSub.