I want to create a MQTT stream which uses username and password for subscription. I am using apache-bahir for creating mqtt stream. When I used MQTTUtils.createStream() method, It only accepts ssc,brokerurl,topic, and StorageLevel as parameters. When I gave the username and password, it shows "Can not resolve symbol createStream().
val lines = MQTTUtils.createStream(ssc, brokerUrl, topic, storageLevel, clientId, username, password, cleanSession, qos, connectionTimeout, keepAliveInterval, mqttVersion)
https://bahir.apache.org/docs/spark/2.3.0/spark-streaming-mqtt/
This page is I refereed for the implementation.
val sc = new SparkContext()
val ssc = new StreamingContext(sc,Seconds(10))
val stream = MQTTUtils.createStream(ssc,"broker.mqttdashboard.com","tag_topic",StorageLevel.DISK_ONLY,"clientid","username","password")
Error Message is Cannot Resolve Symbol MQTTUtils.createStream()