From e71808142ea5577e4d0368ada572077b3a691622 Mon Sep 17 00:00:00 2001 From: Vladimir Dementyev Date: Fri, 7 Jul 2023 18:17:16 -0700 Subject: [PATCH] docs: Redis broker, prepare 1.4.0 --- CHANGELOG.md | 6 ++---- docs/ocpp.md | 6 +++--- docs/reliable_streams.md | 18 +++++++++++++++++- forspell.dict | 1 + 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85ddebc9..6f2ec243 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## master +## 1.4.0 (2023-07-07) + - Add HTTP RPC implementation. ([@palkan][]) - Added telemetry data collection. ([@palkan][]) @@ -26,10 +28,6 @@ Previously, we used a Go routine pool to concurrently delivery broadcasts, which - Add `broker` preset to configure required components to use an in-memory broker. ([@palkan][]) -- Add NATS pub/sub. ([@palkan][]) - -- Add Redis pub/sub. ([@palkan][]) - - New broadcasting architecture: broadcasters, subscribers and brokers. ([@palkan][]) ## 1.3.1 (2023-03-22) diff --git a/docs/ocpp.md b/docs/ocpp.md index 052b4211..920ed19f 100644 --- a/docs/ocpp.md +++ b/docs/ocpp.md @@ -4,7 +4,7 @@ [OCPP][] (Open Charge Point Protocol) is a communication protocol for electric vehicle charging stations. It defines a WebSocket-based RPC communication protocol to manage station and receive status updates. -AnyCable-Go Pro supports OCPP and allows you to _connect_ your charging stations to Ruby or Rails appliciations and control everything using Action Cable at the backend. +AnyCable-Go Pro supports OCPP and allows you to _connect_ your charging stations to Ruby or Rails applications and control everything using Action Cable at the backend. **NOTE:** Currently, AnyCable-Go Pro supports OCPP v1.6 only. Please, contact us if you need support for other versions. @@ -12,13 +12,13 @@ AnyCable-Go Pro supports OCPP and allows you to _connect_ your charging stations - EV charging station connects to AnyCable-Go via WebSocket - The station sends a `BootNotification` request to initialize the connection -- AnyCable transforms this request into several AnyCable RPC calls to match the Action Cable inteface: +- AnyCable transforms this request into several AnyCable RPC calls to match the Action Cable interface: 1) `Authenticate -> Connection#connect` to authenticate the station. 2) `Command{subscribe} -> OCCPChannel#subscribed` to initialize a channel entity to association with this station. 3) `Command{perform} -> OCCPChannel#boot_notification` to handle the `BootNotification` request. - Subsequent requests from the station are converted into `OCCPChannel` action calls (e.g., `Authorize -> OCCPChannel#authorize`, `StartTransaction -> OCCPChannel#start_transaction`). -AnyCable also takes care of heartbeats and ack messages (unless you send them manually, see below). +AnyCable also takes care of heartbeats and acknowledgment messages (unless you send them manually, see below). ## Usage diff --git a/docs/reliable_streams.md b/docs/reliable_streams.md index bc23a4ab..6d259156 100644 --- a/docs/reliable_streams.md +++ b/docs/reliable_streams.md @@ -116,7 +116,23 @@ The default broker adapter. It stores all data in memory. It can be used **only

-Coming soon ⏳ +AnyCable-Go Pro comes with a Redis-based broker adapter. It stores all data in Redis and, thus, can be used in multi-node installations. + +To use Redis broker, you need to provide the `--broker` option with the `redis` adapter name: + +```sh +$ anycable-go --broker=redis + + INFO 2023-07-08T00:46:55.491Z context=main Starting AnyCable 1.4.0-pro-eed05bc (with mruby 1.2.0 (2015-11-17)) (pid: 78585, open file limit: 122880, gomaxprocs: 8, netpoll: true) + INFO 2023-07-08T00:46:55.492Z context=main Using Redis broker at localhost:6379 (history limit: 100, history ttl: 300s, sessions ttl: 300s) + ... +``` + +When you use the `broker` preset with AnyCable-Go, it automatically configures the Redis broker (if Redis credentials are configured). + +#### Streams history expiration + +We use [Redis Streams](https://redis.io/docs/data-types/streams/) to store messages history. Redis doesn't support expiring individual messages in a stream, so we expire the whole stream instead. In other words, the `--history_ttl` option controls the expiration of the whole stream. ## Further reading diff --git a/forspell.dict b/forspell.dict index c4e170d7..6e294ac7 100644 --- a/forspell.dict +++ b/forspell.dict @@ -61,3 +61,4 @@ broadcasted realtime-ification Posthog resumable +ack