同步操作将从 Apache SeaTunnel/SeaTunnel 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Redis sink connector
Used to write data to Redis.
name | type | required | default value |
---|---|---|---|
host | string | yes | - |
port | int | yes | - |
key | string | yes | - |
data_type | string | yes | - |
user | string | no | - |
auth | string | no | - |
db_num | int | no | 0 |
mode | string | no | single |
nodes | list | yes when mode=cluster | - |
format | string | no | json |
expire | long | no | -1 |
common-options | no | - |
Redis host
Redis port
The value of key you want to write to redis.
For example, if you want to use value of a field from upstream data as key, you can assign it to the field name.
Upstream data is the following:
code | data | success |
---|---|---|
200 | get success | true |
500 | internal error | false |
If you assign field name to code
and data_type to key
, two data will be written to redis:
200 -> {code: 200, message: true, data: get success}
500 -> {code: 500, message: false, data: internal error}
If you assign field name to value
and data_type to key
, only one data will be written to redis because value
is not existed in upstream data's fields:
value -> {code: 500, message: false, data: internal error}
Please see the data_type section for specific writing rules.
Of course, the format of the data written here I just take json as an example, the specific or user-configured format
prevails.
Redis data types, support key
hash
list
set
zset
Each data from upstream will be updated to the configured key, which means the later data will overwrite the earlier data, and only the last data will be stored in the key.
Each data from upstream will be split according to the field and written to the hash key, also the data after will overwrite the data before.
Each data from upstream will be added to the configured list key.
Each data from upstream will be added to the configured set key.
Each data from upstream will be added to the configured zset key with a weight of 1. So the order of data in zset is based on the order of data consumption.
redis authentication user, you need it when you connect to an encrypted cluster
Redis authentication password, you need it when you connect to an encrypted cluster
Redis database index ID. It is connected to db 0 by default
redis mode, single
or cluster
, default is single
redis nodes information, used in cluster mode, must like as the following format:
["host1:port1", "host2:port2"]
The format of upstream data, now only support json
, text
will be supported later, default json
.
When you assign format is json
, for example:
Upstream data is the following:
code | data | success |
---|---|---|
200 | get success | true |
Connector will generate data as the following and write it to redis:
{"code": 200, "data": "get success", "success": "true"}
Set redis expiration time, the unit is second. The default value is -1, keys do not automatically expire by default.
Sink plugin common parameters, please refer to Sink Common Options for details
simple:
Redis {
host = localhost
port = 6379
key = age
data_type = list
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。