Skip to content

Commit

Permalink
Merge branch 'main' into chore/migrate-gcp-pubsub
Browse files Browse the repository at this point in the history
  • Loading branch information
paulobressan authored Jun 23, 2023
2 parents 6fb15db + a8b6047 commit 61b99cb
Show file tree
Hide file tree
Showing 10 changed files with 237 additions and 152 deletions.
96 changes: 69 additions & 27 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ aws-sdk-s3 = { version = "0.28.0", optional = true }
# required for CI to complete successfully
openssl = { version = "0.10", optional = true, features = ["vendored"] }

# redis support
redis = { version = "0.23.0", optional = true, features = ["tokio-comp"] }

# features: sink-rabbitmq
lapin = { version = "2.2.1", optional = true }

Expand All @@ -86,6 +83,9 @@ google-cloud-pubsub = { version = "0.16.0", optional = true }
google-cloud-googleapis = { version = "0.10.0", optional = true }
google-cloud-default = { version = "0.4.0", optional = true, features = ["pubsub"] }

# features: sink-redis
r2d2_redis = { version = "0.14.0", optional = true }

# features: deno
deno_core = { version = "0.188.0", optional = true }
deno_runtime = { version = "0.114.0", optional = true }
Expand All @@ -99,3 +99,4 @@ sink-kafka = ["kafka"]
sink-aws-sqs = ["aws-config", "aws-types", "aws-sdk-sqs"]
sink-aws-lambda = ["aws-config", "aws-types", "aws-sdk-lambda"]
sink-gcp-pubsub = ["google-cloud-pubsub", "google-cloud-googleapis", "google-cloud-default"]
sink-redis = ["r2d2_redis"]
16 changes: 3 additions & 13 deletions book/src/sinks/redis_streams.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,19 @@ Example configuration that sends all events into a single stream named `mystream
```toml
[sink]
type = "Redis"
redis_server = "redis://localhost:6379"
url = "redis://localhost:6379"
stream_name = "mystream"
```

Example configuration that sends events into different streams (named by the type of event) of a Redis instance running in port 6379 of the localhost.

```toml
[sink]
type = "Redis"
redis_server = "redis://localhost:6379"
stream_strategy = "ByEventType"
```

### Section: `sink`

- `type`: the literal value `Redis`.
- `redis_server`: the redis server in the format `redis://[<username>][:<password>]@<hostname>[:port][/<db>]`
- `url`: the redis server in the format `redis://[<username>][:<password>]@<hostname>[:port][/<db>]`
- `stream_name` : the name of the redis stream for StreamStrategy `None`, default is "oura" if not specified
- `stream_strategy` : `None` or `ByEventType`

## Conventions

It is possible to send all Event to a single stream or create multiple streams, one for each event type. By appling the [selection](/filters/selection) filter it is possible to define the streams which should be created.
It is possible to send all Event to a single stream or create multiple streams, one for each event type. By appling the [selection](/filters/selection) filter it is possible to define the streams which should be created.

The sink uses the default Redis convention to define the unique entry ID for each message sent to the stream ( `<millisecondsTime>-<sequenceNumber>`).

Expand Down
20 changes: 20 additions & 0 deletions examples/redis/daemon.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[source]
type = "N2N"
peers = ["relays-new.cardano-mainnet.iohk.io:3001"]

[chain]
type = "mainnet"

[intersect]
type = "Tip"

[[filters]]
type = "SplitBlock"

[[filters]]
type = "ParseCbor"

[sink]
type = "Redis"
url = "redis://127.0.0.1/1"
stream_name = "my-stream"
18 changes: 18 additions & 0 deletions examples/redis/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: "3"
services:
redis:
image: redis
container_name: redis
ports:
- "6379:6379"
networks:
- redis-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5

networks:
redis-network:
driver: bridge
3 changes: 0 additions & 3 deletions src/sinks/_pending/redis/mod.rs

This file was deleted.

54 changes: 0 additions & 54 deletions src/sinks/_pending/redis/run.rs

This file was deleted.

Loading

0 comments on commit 61b99cb

Please sign in to comment.