Centrifugo is an open-source scalable real-time messaging server. It instantly delivers messages to application online users connected over supported transports (WebSocket, HTTP-streaming, Server-Sent Events (SSE), GRPC, WebTransport). Centrifugo is built around channel subscriptions – so it's a user-facing PUB/SUB server.
Centrifugo is language-agnostic and can be used to build chat apps, live comments, multiplayer games, real-time data visualizations, collaborative tools, AI streaming responses, etc. in combination with any backend. It is well suited for modern architectures and allows decoupling the business logic from the real-time transport layer.
Official client SDKs are available for JavaScript (browser, Node.js, React Native), Dart/Flutter, Swift, Java, Python, Go, Rust, and .NET. In addition, Centrifugo supports a unidirectional approach for simple use cases with no SDK dependency.
For details, go to the Centrifugo documentation site. For runnable demos see centrifugal/examples.
What's changed
Improvements
- New
--watch-config-fileflag restarts Centrifugo when the configuration in its config file changes – for development. All options apply, unlike with SIGHUP reload. A change which fails validation is logged and ignored, and Centrifugo keeps running. The restart happens in the same process, which keeps its PID. See restart on config file change (#502, #1302). - Graceful shutdown now covers everything Centrifugo runs (#1302). See signal handling:
- async consumers – Kafka, Redis Streams, NATS JetStream, PostgreSQL outbox, AWS SQS, Google Cloud PUB/SUB and Azure Service Bus – stop taking new messages, then finish and acknowledge the messages they already took. A message processed right before a stop is no longer delivered again after the restart;
- connections to Redis, PostgreSQL, NATS, proxy endpoints and JWKS endpoints are closed, and buffered OpenTelemetry spans are exported;
- the whole shutdown finishes within
shutdown.timeout. If it doesn't, Centrifugo logsshutdown timeout reachedand exits with code 1, as before; - when a server, an async consumer or another component fails after start, Centrifugo shuts down gracefully before exiting with code 1, instead of exiting at once;
- startup errors such as a port in use or a bad TLS configuration are reported before Centrifugo starts processing messages from async consumers.
- New channel options
recovery_max_publication_limitandhistory_max_publication_limitset the maximum number of publications returned in one recovery and in one history request for a namespace. Before, onlyclient.recovery_max_publication_limitandclient.history_max_publication_limitexisted, applying to all channels. A namespace whose history holds many small publications – for example, AI responses streamed in chunks – can now have a higher limit than the rest. Zero, the default, keeps using theclient.*options. See channel options and Centrifugo for AI apps (#1294, centrifugal/centrifuge#674). - Better comments in Protobuf definitions for server API and Proxy.
Fixes
- SIGHUP reload pointing channel or RPC options to a proxy which was not created on start was reported as successful, and the next operation using that proxy panicked. Such a reload is now rejected with an error, and the previous configuration stays active – a restart is required to start using a new proxy. Note: enabling a proxy kind for which no proxy was created on start used to reload successfully and then return
108 not availableto clients, and is now rejected too. See signal handling (#1300). - Redis Streams consumer: messages read from Redis right before shutdown could be left unprocessed, and processed only once
visibility_timeoutpassed (30 seconds by default) (#1307). - A server-side subscribe, refresh or message sent with the server API to a client which was still connecting could reach the client before its connect reply. They now come after it (centrifugal/centrifuge#676).
- Other subscribers of a channel could get a leave event without a join event for a client whose server-side subscribe happened while its message queue was full (centrifugal/centrifuge#673).
Miscellaneous
- New Server SDKs page in the docs lists the official server SDKs –
gocent,pycent,jscent,phpcent,rubycent,rustcentandcsharpcent– with install lines, a first publication in each language, notes for AI coding agents, and when to use GRPC instead of the HTTP API. All server SDKs follow a common SDK spec and include not only Centrifugo HTTP API client, but also helper methods for connection/subscription token generation, shared poll signatures, helpers functions to implement proxy handlers. - Introducing centrifuge-rust – a new official client SDK, with Tauri and WASM support out of the box.
- Centrifugo for AI apps now covers checkpoints for long responses, loading a conversation with
getState, and stopping generation from every device. See the new Vercel AI SDK chat example. - Web UI is updated to the latest dependencies (#1305).
- This release is built with Go 1.27.3.
- Dependency updates.
- See also the corresponding Centrifugo PRO release.