Skip to main content

Load Distributor

Load Distributors are essential for managing multiple Interceptor instances, ensuring efficient and balanced message processing. Interceptors are modular components easily integrated into channels to perform preset functions on messages flowing through. As multiple connections can run simultaneously, leading to numerous Interceptor instances, a Load Distributor becomes crucial. It distributes the workload equally among these Interceptor instances on the client side.

This mechanism can also be tailored to facilitate horizontal scaling for custom functionalities, supporting increased demand.


How It Works: Distributing the Load

The Load Distributor intelligently manages message traffic across Interceptor instances, with specific considerations for synchronous and asynchronous operations.

Handling Synchronous Interceptors

When deploying multiple instances of Synchronous Interceptors, enabling the Load Distributor is essential.

  • Compulsory Load Distribution: The Load Distributor efficiently distributes incoming messages among available Synchronous Interceptor instances. This prevents bottlenecks and ensures consistent performance, as the message flow pauses, awaiting a response from a single interceptor instance.
  • Sequential Processing: Each message is processed by only one Synchronous Interceptor instance at a time. The message flow then waits for a definitive response from that specific instance before proceeding. This guarantees a consistent and unambiguous output, eliminating the risk of conflicting responses from multiple instances.

Handling Asynchronous Interceptors

For Asynchronous Interceptors, where the messaging flow does not depend on the interceptor's immediate response, enabling the Load Distributor is optional.

  • Optional Load Distribution: While not strictly required for the primary message flow, the Load Distributor can still aid in distributing the workload. Its absence does not block the core message flow.
  • Broadcast with Acknowledgment: In asynchronous mode, the message can be broadcast to all configured Asynchronous Interceptor instances. The system proceeds with the message flow as soon as it receives an acknowledgment from any one of these instances. This ensures that at least one interceptor has received the message for processing, enabling non-blocking operations while maintaining a baseline level of processing assurance.