跳到主要内容
版本:Next

钉钉

钉钉数据接收器

支持的引擎

Spark
Flink
SeaTunnel Zeta

主要特性

描述

通过钉钉自定义机器人 Webhook,将 SeaTunnel 行数据发送到钉钉群聊的接收器插件。作业配置中使用的连接器标识为 DingTalk。每一行数据都会使用配置的机器人密钥进行签名,然后发送到钉钉机器人地址。

数据类型映射

钉钉连接器会把每一行通过 SeaTunnelRow.toString() 序列化为纯文本,并作为一条消息发送给钉钉机器人。 线上传输的是单一文本消息,不存在按字段区分的 JSON 结构 —— 不论源字段类型是什么,整行都会被转换为 一条文本消息。

接收器选项

名称类型是否必须默认值描述
urlString-钉钉机器人 Webhook 地址,格式 https://oapi.dingtalk.com/robot/send?access_token=XXXXXX
secretString-用于对请求进行签名的钉钉机器人密钥。
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
ChangeCommitVersion
[improve] dingtalk sink options (#8742)https://github.com/apache/seatunnel/commit/f2145dcc4f2.3.10
[Feature][Restapi] Allow metrics information to be associated to logical plan nodes (#7786)https://github.com/apache/seatunnel/commit/6b7c53d03c2.3.9
[Improve] Remove use SeaTunnelSink::getConsumedType method and mark it as deprecated (#5755)https://github.com/apache/seatunnel/commit/8de74081002.3.4
[Improve][build] Give the maven module a human readable name (#4114)https://github.com/apache/seatunnel/commit/d7cd6010512.3.1
[Improve][Project] Code format with spotless plugin. (#4101)https://github.com/apache/seatunnel/commit/a2ab1665612.3.1
[Improve][Connector-V2][DingTalk] Unified exception for dingtalk sink connector (#3678)https://github.com/apache/seatunnel/commit/0a095625152.3.0
[Hotfix][OptionRule] Fix option rule about all connectors (#3592)https://github.com/apache/seatunnel/commit/226dc6a1192.3.0
[improve][connector] The Factory#factoryIdentifier must be consistent with PluginIdentifierInterface#getPluginName (#3328)https://github.com/apache/seatunnel/commit/d9519d696a2.3.0
[Improve][Connector-V2][DingTalk] Add DingTalk Sink Factory (#3324)https://github.com/apache/seatunnel/commit/56be228ad22.3.0
[Improve][build] Improved scope of maven-shade-plugin (#2665)https://github.com/apache/seatunnel/commit/93bc8bd1162.2.0-beta
[#2606]Dependency management split (#2630)https://github.com/apache/seatunnel/commit/fc047be69b2.2.0-beta
[Feature][Connector-V2] Add Dingtalk Sink #2257 (#2285)https://github.com/apache/seatunnel/commit/88a26d5a292.2.0-beta