定义camel s3源连接器时出错

webghufk  于 2021-06-04  发布在  Kafka
关注(0)|答案(1)|浏览(759)

我试图在我们的合流环境中定义一个camels3源连接器。
这是我正在使用的配置

{
    "name": "CamelAWSS3SourceConnector",
    "config": {
        "connector.class": "org.apache.camel.kafkaconnector.awss3.CamelAwss3SourceConnector",
        "key.converter": "org.apache.kafka.connect.storage.StringConverter",
        "value.converter": "org.apache.camel.kafkaconnector.awss3.converters.S3ObjectConverter",
        "camel.source.maxPollDuration": "10000",
        "topics": "TEST-S3-SOURCE-POC",
        "camel.source.path.bucketNameOrArn": "json-poc",
        "camel.component.aws-s3.region": "us-east-1",
        "tasks.max": "2",
        "camel.source.endpoint.autocloseBody": "true"
    }
}

这就是我在定义连接器时收到的错误

{
    "error_code": 405,
    "message": "HTTP 405 Method Not Allowed"
} {
    "name": "CamelAWSS3SourceConnector",
    "connector": {
        "state": "RUNNING",
        "worker_id": "confluent-connect-server2:8083"
    },
    "tasks": [{
        "id": 0,
        "state": "FAILED",
        "worker_id": "confluent-connect-server2",
        "trace": "org.apache.kafka.connect.errors.ConnectException: Failed to create and start Camel context
    at org.apache.camel.kafkaconnector.CamelSourceTask.start(CamelSourceTask.java:118)
    at org.apache.kafka.connect.runtime.WorkerSourceTask.execute(WorkerSourceTask.java:215)
    at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:184)
    at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:234)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: Option bucketNameOrArn is required when creating endpoint uri with syntax aws-s3://bucketNameOrArn
    at org.apache.camel.support.component.EndpointUriFactorySupport.buildPathParameter(EndpointUriFactorySupport.java:53)
    at org.apache.camel.component.aws.s3.S3EndpointUriFactory.buildUri(S3EndpointUriFactory.java:103)
    at org.apache.camel.kafkaconnector.utils.TaskHelper.buildUrl(TaskHelper.java:68)
    at org.apache.camel.kafkaconnector.CamelSourceTask.start(CamelSourceTask.java:98)
    ... 8 more"
    }],
    "type": "source"
}

造成上述错误的原因是什么?
我被告知由于connect服务器是一个ec2示例,所以我不必在这里定义aws参数。对吗?
谢谢您
注意:要添加两个connect服务器,输出中只显示其中一个服务器的错误

xxls0lw8

xxls0lw81#

我只是想在这里贴个答案,以防有人碰到这个。
问题是在使用put添加或更新连接器时,curl请求的url格式需要 http(s)://<serverurl>/<connectorName>/config . 我的json包含键“name:”,url只是http(s)://。最初,我使用post创建了连接器,然后尝试使用put-to-update(实际上,添加)bucketnameorrn键进行更新,但实际上没有得到更新。

相关问题