aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReynold Xin <rxin@apache.org>2014-01-10 23:25:15 -0800
committerReynold Xin <rxin@apache.org>2014-01-10 23:25:15 -0800
commit92ad18b00e9c6a667723b93b9d2139248de333b4 (patch)
tree75dc037fccf455554f36a29c83b03fe1e42b1789
parent0b5ce7af17c96fcfbefe8e2fb750e171bbd9163a (diff)
parent645f5e83ee38a329332850bf44ea67b0711a705c (diff)
downloadspark-92ad18b00e9c6a667723b93b9d2139248de333b4.tar.gz
spark-92ad18b00e9c6a667723b93b9d2139248de333b4.tar.bz2
spark-92ad18b00e9c6a667723b93b9d2139248de333b4.zip
Merge pull request #376 from prabeesh/master
Change clientId to random clientId The client identifier should be unique across all clients connecting to the same server. A convenience method is provided to generate a random client id that should satisfy this criteria - generateClientId(). Returns a randomly generated client identifier based on the current user's login name and the system time. As the client identifier is used by the server to identify a client when it reconnects, the client must use the same identifier between connections if durable subscriptions are to be used.
-rw-r--r--external/mqtt/src/main/scala/org/apache/spark/streaming/mqtt/MQTTInputDStream.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/external/mqtt/src/main/scala/org/apache/spark/streaming/mqtt/MQTTInputDStream.scala b/external/mqtt/src/main/scala/org/apache/spark/streaming/mqtt/MQTTInputDStream.scala
index c8987a3ee0..41e813d48c 100644
--- a/external/mqtt/src/main/scala/org/apache/spark/streaming/mqtt/MQTTInputDStream.scala
+++ b/external/mqtt/src/main/scala/org/apache/spark/streaming/mqtt/MQTTInputDStream.scala
@@ -80,7 +80,7 @@ class MQTTReceiver(brokerUrl: String,
var peristance: MqttClientPersistence = new MemoryPersistence()
// Initializing Mqtt Client specifying brokerUrl, clientID and MqttClientPersistance
- var client: MqttClient = new MqttClient(brokerUrl, "MQTTSub", peristance)
+ var client: MqttClient = new MqttClient(brokerUrl, MqttClient.generateClientId(), peristance)
// Connect to MqttBroker
client.connect()