Reliable Fanout Use Cases with Valkey & Redis

Published on
June 4, 2025

One of the biggest challenges for developers of distributed applications is ensuring that messages are reliably delivered from a single producer to multiple consumers, a process known as fanout. Redisson PRO, a Java client that allows developers to work with Valkey and Redis message queues via familiar objects and methods, solves this problem with its Reliable Fanout feature.

According to the Redisson PRO documentation, the Reliable Fanout object ensures message delivery to multiple Reliable Queue objects in a publish-subscribe (pub/sub) model. Every published message is sent to each queue subscribed to the same fanout object. All fanout operations are executed atomically to ensure data consistency and prevent race conditions, and the Reliable Fanout object is fully thread-safe.

This means Java developers can rest assured that messages will reach their intended destinations, even during transient network failures or subscriber downtime. 

Use Cases

Below are some use cases to show the value of Reliable Fanout.

Event Broadcasting to Microservices

In modern microservice architectures, decoupling services while ensuring consistent data flow is a key objective. Consider a critical business event, such as an "Order Placed" message. This single event often needs to trigger actions across various independent services — a billing service to process payment, a shipping service to arrange delivery, a notification service to inform the customer, and so on.

Reliable Fanout permits this "Order Placed" event to be published once and then efficiently broadcast to dedicated Reliable Queues for each subscribing microservice. This ensures that the billing, shipping, and notification services all receive the event. True to the microservices model, they also process it independently and asynchronously. If one service is temporarily unavailable, it doesn't halt the others. They're all guaranteed to receive the event with exactly-once or at-least-once semantics. The independent services can, therefore, recover from failures without message loss.

Real-Time Data Distribution

Real-time data often goes to more than one destination. Think of live financial dashboards displaying stock prices, operational monitoring systems aggregating metrics, or IoT platforms processing streams of sensor updates. In these scenarios, analytical engines, visualization tools, alerting systems, and others all require access to the same continuous data stream.

Reliable Fanout ensures that every bit of incoming data is broadcast to all subscribed real-time consumers. Even if a particular dashboard application experiences a temporary network glitch or a monitoring service needs to restart, Redisson PRO's fanout mechanism guarantees that no messages are lost. Upon reconnection or restart, the consumer will receive any missed updates, ensuring a consistent and accurate view across all consuming applications.

Multi-Tenant or Multi-Region Data Replication

Maintaining data consistency can be a significant challenge for Software-as-a-Service (SaaS) platforms that serve multiple tenants or applications distributed across different regions for improved responsiveness. User updates, such as configuration changes, toggling of feature flags, or modifications to shared data, must be reliably propagated to all nodes across the system.

Reliable Fanout enables these updates to be broadcast once and then distributed to individual Reliable Queues. The inherent reliability of the fanout mechanism guarantees data consistency for all tenants and regional deployments.

Decoupled Workflow Orchestration

Modern business processes often involve complex workflows composed of multiple distinct steps. The completion of one stage can trigger several parallel or independent actions. For example, in an eCommerce order processing pipeline, tasks like payment processing, picking from the warehouse, and inventory updates need to occur. 

Reliable Fanout can orchestrate such a decoupled workflow. When one event broadcasts a "step completed" event (such as "payment received"), it's delivered to multiple downstream processing components, and each one subscribes to these types of messages. All subsequent processes can initiate their tasks, like inventory management or shipping, independently and with their own retry mechanisms and error-handling logic.

Audit, Compliance, and Archival

Many businesses fall under stringent regulatory and compliance mandates. They must maintain comprehensive, immutable records of all significant events to demonstrate compliance to auditors. These same events must drive business processes. For example, every financial transaction might need to be logged for auditing purposes while also being processed by account management and notification systems.

Reliable Fanout offers an elegant solution for these dual requirements. When a business event occurs, it can be published once and then delivered to multiple destinations, including a dedicated audit queue explicitly designed for logging and long-term archival. The same event can be fanned out to various operational queues for immediate processing by the relevant business services.

Selective Message Routing (With Filtering)

Reliable Fanout also offers per-subscriber filtering capabilities. Developers can use this feature for sophisticated content-based routing directly at the consumption point. For instance, different subscribers to the same event stream might only be interested in messages containing specific header information or those that match a particular pattern within the payload. 

By applying these filters, each consumer only receives a subset of messages relevant to its function. Targeted delivery gives developers fine-grained control over message flow and reduces processing overhead for individual subscribers, all without a complex routing infrastructure.

Blue/Green or Canary Deployments

Reliable Fanout enables safer, staged rollout strategies like blue/green or canary deployments. For instance, during an update, a new version of a service (the "green" or "canary" instance) can subscribe to the same source as the existing, stable version (the "blue" instance). Both versions receive an identical stream of live production events in parallel. 

This approach to deployments allows for thorough testing of the new version under real-world conditions. Once the latest version is validated, traffic can be fully migrated by simply unsubscribing from thee oldr version.

Multi-Channel Notification Systems

Modern applications often require sending notifications through multiple channels, including email, SMS, and push notifications. 

With Reliable Fanout, a single notification event can be published once and then broadcast to separate queues, each feeding a specific channel processor: one for handling email dispatch, another for SMS gateway integration, a third for managing push notification delivery, and so on. Each channel processor independently manages its own delivery logic, retry policies, and error handling.

Build Resilient Decoupled Applications With Reliable Fanout

As these use cases show, Reliable Fanout empowers Java developers to build more resilient, scalable, and decoupled applications on top of Valkey or Redis message queues.