我已经添加了
"org.apache.bahir" %% "spark-streaming-mqtt" % "2.4.0"
到我的build.sbt
,并使用
df
.writeStream
.format("org.apache.bahir.sql.streaming.mqtt.MQTTStreamSinkProvider")
.outputMode("complete")
.option("topic", "mytopic")
.option("brokerUrl", "tcp://localhost:1883")
.start()
.awaitTermination(20000)
在代码中,但得到
java.lang.ClassNotFoundException: Failed to find data source: org.apache.bahir.sql.streaming.mqtt.MQTTStreamSinkProvider. Please find packages at http://spark.apache.org/third-party-projects.html
at org.apache.spark.sql.execution.datasources.DataSource$.lookupDataSource(DataSource.scala:679)