Redis Streams Ingress Configuration
Redis Streams data ingestion is available using ingress of type redis
.
Examples Repo
Example Redis Streams configuration files showcasing all features we will discuss can be found in our Examples Repo .
Settings
The Redis settings
in the configuration file are used to configure data ingestion from Redis streams.
Below is a detailed description of each field within the Redis settings
:
Field | Required | Configurable | Description |
---|---|---|---|
host |
true |
true |
Host name of the Redis instance to connect to. |
port |
true |
true |
Port number of the Redis instance to connect to. |
streams |
true |
true |
Streams field and starting ID, following the same format as the Redis CLI, e.g. vehicles 0 . |
group |
false |
true |
The name of the consumer group. |
consumer |
false |
true |
The name of the consumer within the consumer group. |
block |
false |
true |
Time in ms to block for while waiting for new entries (default is to wait indefinitely). |
count |
false |
true |
The amount of entries to get with each read. |
Message Structure
The message structure of received Redis stream entries is:
{ "stream": ..., "id": ..., value: {...} }
Example
The configuration below defines a Redis Streams ingress where entries are consumed from the specified Redis stream and relayed to vehicle agents.
{
"ingress": {
"type": "redis",
"settings": {
"host": "host.docker.internal",
"port": "6379",
"streams": "vehicles 0"
},
"relay": {
"agent": "vehicle",
"idExtractor": "$value.id",
"valueExtractor": "$value"
}
}
}
Nstream is licensed under the Redis Source Available License 2.0 (RSALv2).