Skip to content

Commit

Permalink
Update MQTTWordCount.scala
Browse files Browse the repository at this point in the history
  • Loading branch information
prabeesh committed Oct 22, 2013
1 parent dbafa11 commit 9ca1bd9
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,13 @@ import org.eclipse.paho.client.mqttv3.MqttTopic
* A simple Mqtt publisher for demonstration purposes, repeatedly publishes
* Space separated String Message "hello mqtt demo for spark streaming"
*/

object MQTTPublisher {

var client: MqttClient = _

def main(args: Array[String]) {
if (args.length < 2) {
System.err.println(
"Usage: MQTTPublisher <MqttBrokerUrl> <topic>")
System.err.println("Usage: MQTTPublisher <MqttBrokerUrl> <topic>")
System.exit(1)
}

Expand All @@ -52,7 +50,6 @@ object MQTTPublisher {
client = new MqttClient(brokerUrl, MqttClient.generateClientId(), peristance)
} catch {
case e: MqttException => println("Exception Caught: " + e)

}

client.connect()
Expand All @@ -66,7 +63,6 @@ object MQTTPublisher {
println("Published data. topic: " + msgtopic.getName() + " Message: " + message)
}
client.disconnect()

}
}

Expand All @@ -87,7 +83,6 @@ object MQTTPublisher {
* and run the example as
* `$ ./run-example org.apache.spark.streaming.examples.MQTTWordCount local[2] tcp://localhost:1883 foo`
*/

object MQTTWordCount {

def main(args: Array[String]) {
Expand Down

0 comments on commit 9ca1bd9

Please sign in to comment.