钉钉
钉钉数据接收器
支持的引擎
Spark
Flink
SeaTunnel Zeta
主要特性
描述
通过钉钉自定义机器人 Webhook,将 SeaTunnel 行数据发送到钉钉群聊的接收器插件。作业配置中使用的连接器标识为 DingTalk。每一行数据都会使用配置的机器人密钥进行签名,然后发送到钉钉机器人地址。
数据类型映射
钉钉连接器会把每一行通过 SeaTunnelRow.toString() 序列化为纯文本,并作为一条消息发送给钉钉机器人。
线上传输的是单一文本消息,不存在按字段区分的 JSON 结构 —— 不论源字段类型是什么,整行都会被转换为
一条文本消息。
接收器选项
| 名称 | 类型 | 是否必须 | 默认值 | 描述 |
|---|---|---|---|---|
| url | String | 是 | - | 钉钉机器人 Webhook 地址,格式 https://oapi.dingtalk.com/robot/send?access_token=XXXXXX。 |
| secret | String | 是 | - | 用于对请求进行签名的钉钉机器人密钥。 |
| common-options | 否 | - | Sink 插件通用参数,详见 Sink 常见选项。 |
url [String]
钉钉机器人地址格式为 https://oapi.dingtalk.com/robot/send?access_token=XXXXXX,其中 access_token
是钉钉群机器人设置中生成的令牌。
secret [String]
钉钉机器人密钥,用于对发往 url 中机器人的消息进行签名。连接器使用该密钥为消息生成签名,以便
钉钉端校验请求来源。该密钥必须与 url 中机器人绑定的密钥保持一致。签名客户端在写入器首次发送时
按需创建一次,并在该写入器生命周期内复用,不会对每条消息重新计算签名。
common options
Sink 插件通用参数,请参考 Sink 常见选项 了解详情。
任务示例
简单示例
通过已配置的机器人将行数据发送到钉钉群。
sink {
DingTalk {
url = "https://oapi.dingtalk.com/robot/send?access_token=ec646cccd028d978a7156ceeac5b625ebd94f586ea0743fa501c100007890"
secret = "SEC093249eef7aa57d4388aa635f678930c63db3d28b2829d5b2903fc1e5c10000"
}
}
配合上游源使用
一个典型的端到端作业,从 fake 源读取数据并转发到钉钉。
env {
parallelism = 1
job.mode = "BATCH"
}
source {
FakeSource {
schema = {
fields {
id = int
name = string
score = double
}
}
rows = [
{ kind = "INSERT", fields = [1, "alice", 9.5] }
]
}
}
sink {
DingTalk {
url = "https://oapi.dingtalk.com/robot/send?access_token=ec646cccd028d978a7156ceeac5b625ebd94f586ea0743fa501c100007890"
secret = "SEC093249eef7aa57d4388aa635f678930c63db3d28b2829d5b2903fc1e5c10000"
}
}
变更日志
Change Log
| Change | Commit | Version |
|---|---|---|
| [improve] dingtalk sink options (#8742) | https://github.com/apache/seatunnel/commit/f2145dcc4f | 2.3.10 |
| [Feature][Restapi] Allow metrics information to be associated to logical plan nodes (#7786) | https://github.com/apache/seatunnel/commit/6b7c53d03c | 2.3.9 |
[Improve] Remove use SeaTunnelSink::getConsumedType method and mark it as deprecated (#5755) | https://github.com/apache/seatunnel/commit/8de7408100 | 2.3.4 |
| [Improve][build] Give the maven module a human readable name (#4114) | https://github.com/apache/seatunnel/commit/d7cd601051 | 2.3.1 |
| [Improve][Project] Code format with spotless plugin. (#4101) | https://github.com/apache/seatunnel/commit/a2ab166561 | 2.3.1 |
| [Improve][Connector-V2][DingTalk] Unified exception for dingtalk sink connector (#3678) | https://github.com/apache/seatunnel/commit/0a09562515 | 2.3.0 |
| [Hotfix][OptionRule] Fix option rule about all connectors (#3592) | https://github.com/apache/seatunnel/commit/226dc6a119 | 2.3.0 |
| [improve][connector] The Factory#factoryIdentifier must be consistent with PluginIdentifierInterface#getPluginName (#3328) | https://github.com/apache/seatunnel/commit/d9519d696a | 2.3.0 |
| [Improve][Connector-V2][DingTalk] Add DingTalk Sink Factory (#3324) | https://github.com/apache/seatunnel/commit/56be228ad2 | 2.3.0 |
| [Improve][build] Improved scope of maven-shade-plugin (#2665) | https://github.com/apache/seatunnel/commit/93bc8bd116 | 2.2.0-beta |
| [#2606]Dependency management split (#2630) | https://github.com/apache/seatunnel/commit/fc047be69b | 2.2.0-beta |
| [Feature][Connector-V2] Add Dingtalk Sink #2257 (#2285) | https://github.com/apache/seatunnel/commit/88a26d5a29 | 2.2.0-beta |