1

在我的 mqtt-source.properties 文件中包含

name=mqtt-source
connector.class=com.datamountaineer.streamreactor.connect.mqtt.source.MqttSourceConnector
tasks.max=1 connect.mqtt.username=testuser
connect.mqtt.password=0d6be69b264717f2dd33652e212b173104b4a647b7c11ae72e9885f11cd312fb
connect.mqtt.connection.clean=true
connect.mqtt.connection.timeout=1000
connect.mqtt.kcql=INSERT INTO data SELECT * FROM /mjson WITHCONVERTER=`com.datamountaineer.streamreactor.connect.converters.source.JsonSimpleConverter`
connect.mqtt.connection.keep.alive=1000
connect.mqtt.client.id=test123
connect.mqtt.converter.throw.on.error=true
connect.mqtt.hosts=tcp://127.0.0.1:1883
connect.mqtt.service.quality=1
kafka.topic=datatop mqtt.topic=mjson

我在创建源连接器时遇到了以下问题。注意 [使用 kafka-connect-cli-1.0.6-all.jar 创建源连接器] 。

### Complete log file
[2018-02-15 14:35:18,445] INFO Connecting to tcp://127.0.0.1:1883 (com.datamountaineer.streamreactor.connect.mqtt.connection.MqttClientConnectionFn$:41)
[2018-02-15 14:35:18,458] INFO WorkerSourceTask{id=mqtt-source-0} Committing offsets (org.apache.kafka.connect.runtime.WorkerSourceTask:306)
[2018-02-15 14:35:18,459] INFO WorkerSourceTask{id=mqtt-source-0} flushing 0 outstanding messages for offset commit (org.apache.kafka.connect.runtime.WorkerSourceTask:323)
[2018-02-15 14:35:18,459] ERROR WorkerSourceTask{id=mqtt-source-0} Task threw an uncaught and unrecoverable exception (org.apache.kafka.connect.runtime.WorkerTask:172)
Bad user name or password (4)
    at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:28)
    at org.eclipse.paho.client.mqttv3.internal.ClientState.notifyReceivedAck(ClientState.java:988)
    at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:145)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    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)
[2018-02-15 14:35:18,459] ERROR WorkerSourceTask{id=mqtt-source-0} Task is being killed and will not recover until manually restarted (org.apache.kafka.connect.runtime.WorkerTask:173)

Moquette MQTT 版本

分发 0.10-bundle-tar

JVM版本

java版本“1.8.0_161”

4

0 回答 0