编写自定义 Kafka 连接单消息转换 [英] Write a custom Kafka connect single message transform

查看:25
本文介绍了编写自定义 Kafka 连接单消息转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经配置了一个 kafka 连接 Mongodb 接收器,我想通过实现一些自定义逻辑来转换消息.

I have configured a kafka connect Mongodb sink and I want to transform the message by implementing some custom logic.

Kafka 连接是否仅限于内置 SMT(或)是否可以编写自定义 SMT.如果不是,我怎么能做到这一点?通过流?

Is Kafka connect limited to in-built SMTs (or) is it possible to write a custom SMT. If not how can I achieve this? through streams?

推荐答案

Kafka 连接是否仅限于内置 SMT

Is Kafka connect limited to in-built SMTs

不,不是.您可以创建自己的并将它们添加到您的插件路径

No, it is not. You can create your own and add them to your plugin path

转换被编译为 JAR,并通过 Connect 工作器的属性文件中指定的 plugin.path 提供给 Kafka Connect.安装后,可以在连接器属性中配置转换.

Transformations are compiled as JARs and are made available to Kafka Connect via the plugin.path specified in the Connect worker’s properties file. Once installed, the transforms can be configured in the connector properties.

https://www.confluent.io/blog/kafka-connect-single-message-transformation-tutorial-with-examples

示例 repo https://github.com/confluentinc/kafka-connect-insert-uuid

或者我自己的 https://github.com/OneCricketeer/schema-registry-转移-smt

这篇关于编写自定义 Kafka 连接单消息转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆