Skip to content

Commit

Permalink
docs: Redis broker, prepare 1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan committed Jul 8, 2023
1 parent 49350b5 commit e718081
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
6 changes: 2 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## master

## 1.4.0 (2023-07-07)

- Add HTTP RPC implementation. ([@palkan][])

- Added telemetry data collection. ([@palkan][])
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions docs/ocpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@

[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.

## How it works

- 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

Expand Down
18 changes: 17 additions & 1 deletion docs/reliable_streams.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,23 @@ The default broker adapter. It stores all data in memory. It can be used **only

<p class="pro-badge-header"></p>

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

Expand Down
1 change: 1 addition & 0 deletions forspell.dict
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@ broadcasted
realtime-ification
Posthog
resumable
ack

0 comments on commit e718081

Please sign in to comment.