transforms.route.topic.expression和groovy expression

hivapdat  于 2021-06-04  发布在  Kafka
关注(0)|答案(0)|浏览(326)

我正在尝试使用debezium transforms.route.topic.expression在这里输入连接器配置中的条目

"transforms": "dropPrefix,unwrapi,route",
"transforms.dropPrefix.type": "org.apache.kafka.connect.transforms.RegexRouter",
"transforms.dropPrefix.regex": "rocketlawyer.dbo.(.*)",
"transforms.dropPrefix.replacement": "$1",
"transforms.unwrap.type": "io.debezium.transforms.ExtractNewRecordState",
"transforms.unwrap.drop.tombstones": "false",
"transforms.route.type": "io.debezium.transforms.ContentBasedRouter",
"transforms.route.language": "jsr223.groovy",
"transforms.route.topic.expression": "value.snapshotequals('true') ? ${topic} : cdc.$1"

当我应用配置调用时,我得到以下错误

iguenkin_rocketlawyer_com@dbadm-r208:~/confluent$ curl -d  @mssql_trg_cf.json -H "Content-Type: application/json"  -X PUT http://localhost:8083/connectors/mssql_trg/config | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1326  100   242  100  1084  30250   132k --:--:-- --:--:-- --:--:--  161k
{
  "error_code": 500,
  "message": "Unexpected character ('\"' (code 34)): was expecting comma to separate Object entries\n at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 1, column: 832]"
}

专栏:832
“transforms.route.topic.expression”:“value.snapshotequals('true')${主题}:cdc.$1“
列830是字符串中的空白 : cdc 问题来了
我如何确保jsr223.groovy已经安装并且可以被转换访问,因为据我所知它是dibezium connector的一部分,所以它没有作为单独的插件在这里列出安装了jars whee debezium的列表
-rw-r--r--1 iguenkin\u rocketlawyer\u com 1234193955 20272 12月9日20:44 debezium-api-1.3.1.final.jar -rw-r--r--1 iguenkin\u rocketlawyer\u com 1234193955 91369 12月9日20:44 debezium-connector-sqlserver-1.3.1.final.jar -rw-r--r--1 iguenkin\u rocketlawyer\u com 1234193955 844500 12月9日20:44 debezium-core-1.3.1.final.jar -rw-r--r--1 iguenkin\u rocketlawyer\u com 1234193955 19090年12月15日22:01 debezium-scripting-1.3.1.final.jar -rw-r--r--1 iguenkin\u rocketlawyer\u com 1234193955 16839 12月16日01:04 groovy-jsr223-3.0.7-indy.jar
如果安装了groovy,表达式有什么问题?我使用了以下文档来设置连接器https://debezium.io/documentation/reference/configuration/content-based-routing.html

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题