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, 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
centrifugo_transport_frame_sizemetric – a histogram of frame sizes received from client connections. One frame may contain several commands, so this can't be calculated from the existing per-command counters. Helps to choose a good value forwebsocket.message_size_limit, which is applied to the whole frame (centrifugal/centrifuge#620). - Faster Protobuf client protocol command encoding: ~2.1x faster and ~55% less memory alloc
- Less work on every client command: config accessors and the channel options cache no longer copy structs on each call (#1215).
- PostgreSQL broker, map broker and controller now validate
table_prefixon start. A prefix with a hyphen, space or dot used to produce a confusing syntax error inside a generatedCREATEstatement (#1223).
Fixes
- Async consumers: a
context.Cancelederror returned by the message dispatcher was treated as a shutdown signal. In the Kafka consumer this could skip records and then commit an offset after them, losing messages. This did not happen right now in Centrifugo, but inaccurately introduced code could cause this in the future. Fixed for Kafka and SQS (#1221). - fix(pgoutbox): tolerate 42P07 when another node creates the partition first #1220. Thanks to @AlexeyShalaev for bringing and fixing this.
- PostgreSQL engine: handle the case when several nodes create the schema at the same time. Before that a node which lost the race could fail to start with
error initializing Postgres ... schema. - PostgreSQL map broker: the fast path in
EnsureSchemanever worked, so every node start ran the full DDL batch again. It works now and also refreshes the partition lookahead (#1223). - Fix a race in log throttling of the connection limit check – it could print many duplicate warnings instead of one per throttle interval (#1214).
- Some config validation errors mentioned keys which don't exist, so it was hard to find the option to fix (#1213).
- Admin web UI: fix uptime formatting on the Status page (centrifugal/web#71).
Miscellaneous
- This release is built with Go 1.26.8.
- Dependency updates.
- See also the corresponding Centrifugo PRO release.
New Contributors
- @AlexeyShalaev made their first contribution in #1220
Full Changelog: v6.9.3...v6.9.4