Skip to content

Add cluster-level automatic failover support (AutoClusterFailover) #479

@graham-macdonald-simplisafe

Description

Summary

The Node.js client does not support cluster-level failover — the ability for a Pulsar client to automatically switch from a primary cluster to a secondary cluster when the primary becomes unavailable.

Context

The Java client has supported this since Pulsar 2.10 (May 2022) via AutoClusterFailover and ControlledClusterFailover, both built on the ServiceUrlProvider abstraction. The .NET client (Pulsar.Client) has also independently implemented equivalent functionality via IServiceInfoProvider. The Node.js client wraps the C++ library, which also does not yet support cluster-level failover (tracked in apache/pulsar-client-cpp#568). Once the C++ client adds AutoClusterFailover support, this issue tracks surfacing it in the Node.js ClientConfig.

Proposed API

interface AutoClusterFailoverConfig {
    primary: string;
    secondary: string[];
    failoverDelayMs?: number;       // default: 30000
    switchBackDelayMs?: number;     // default: 60000
    checkIntervalMs?: number;       // default: 30000
    secondaryAuthentication?: { [serviceUrl: string]: AuthenticationConfig };
  }

  interface ClientConfig {
    serviceUrl?: string;
    serviceUrlProvider?: AutoClusterFailoverConfig;
    // ... existing properties ...
  }

Depends On

Use Case

Deploying Pulsar with geo-replication across multiple AWS regions and needing producer clients to automatically failover to a secondary cluster when their local cluster becomes unavailable, without requiring DNS-level failover or application-level detection logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions