Bläddra i källkod

feat(source): remove sharedSubscription option from mqtt source

ngjaying 4 år sedan
förälder
incheckning
1f26bd1cce

+ 0 - 10
docs/en_US/rules/sources/mqtt.md

@@ -6,9 +6,7 @@ Kuiper provides built-in support for MQTT source stream, which can subscribe the
 #Global MQTT configurations
 default:
   qos: 1
-  sharedSubscription: true
   servers: [tcp://127.0.0.1:1883]
-  concurrency: 1
   #username: user1
   #password: password
   #certificationPath: /var/kuiper/xyz-certificate.pem
@@ -30,13 +28,6 @@ Use can specify the global MQTT settings here. The configuration items specified
 
 The default subscription QoS level.
 
-### concurrency
-How many instances will be started. By default, only an instance will be run. If more than one instance is specified, the topic must be a shared subscription topic.
-
-### sharedSubscription
-
-Whether use the shared subscription mode or not. If using the shared subscription mode, then there are multiple Kuiper process can be load balanced.
-
 ### servers
 
 The server list for MQTT message broker. Currently, only ``ONE`` server can be specified.
@@ -109,4 +100,3 @@ demo (
 ```
 
 The configuration keys used for these specific settings are the same as in ``default`` settings, any values specified in specific settings will overwrite the values in ``default`` section.
-

+ 0 - 9
docs/zh_CN/rules/sources/mqtt.md

@@ -6,9 +6,7 @@ Kuiper 为 MQTT 源流提供了内置支持,流可以订阅来自 MQTT 代理
 #全局MQTT配置
 default:
   qos: 1
-  sharedsubscription: true
   servers: [tcp://127.0.0.1:1883]
-  concurrency: 1
   #username: user1
   #password: password
   #certificationPath: /var/kuiper/xyz-certificate.pem
@@ -31,13 +29,6 @@ demo: #Conf_key
 
 默认订阅QoS级别。
 
-### concurrency
-设置运行的协程数,默认值为1。如果设置协程数大于1,必须使用共享订阅模式。
-
-### sharedsubscription
-
-是否使用共享订阅模式。 如果使用共享订阅模式,那么多个 Kuiper 进程可以进行负载平衡。
-
 ### servers
 
 MQTT 消息代理的服务器列表。 当前,只能指定一个服务器。

+ 0 - 28
etc/mqtt_source.json

@@ -34,20 +34,6 @@
 				"zh_CN": "QoS 级别"
 			}
 		}, {
-			"name": "sharedSubscription",
-			"default": true,
-			"optional": true,
-			"control": "radio",
-			"type": "bool",
-			"hint": {
-				"en_US": "Whether use the shared subscription mode or not. If using the shared subscription mode, then there are multiple Kuiper process can be load balanced.",
-				"zh_CN": "是否使用共享订阅模式。 如果使用共享订阅模式,那么多个 Kuiper 进程可以进行负载平衡。"
-			},
-			"label": {
-				"en_US": "SharedSubscription",
-				"zh_CN": "使用共享订阅模式"
-			}
-		}, {
 			"name": "servers",
 			"default": ["tcp://127.0.0.1:1883"],
 			"optional": true,
@@ -62,20 +48,6 @@
 				"zh_CN": "服务器列表"
 			}
 		}, {
-			"name": "concurrency",
-			"default": 1,
-			"optional": true,
-			"control": "text",
-			"type": "int",
-			"hint": {
-				"en_US": "How many instances will be started. By default, only an instance will be run. If more than one instance is specified, the topic must be a shared subscription topic.",
-				"zh_CN": "设置运行的协程数,默认值为1。如果设置协程数大于1,必须使用共享订阅模式。"
-			},
-			"label": {
-				"en_US": "Concurrency",
-				"zh_CN": "协程数"
-			}
-		}, {
 			"name": "username",
 			"default": "",
 			"optional": true,

+ 0 - 2
etc/mqtt_source.yaml

@@ -1,9 +1,7 @@
 #Global MQTT configurations
 default:
   qos: 1
-  sharedSubscription: true
   servers: [tcp://127.0.0.1:1883]
-  concurrency: 1
   #username: user1
   #password: password
   #certificationPath: /var/kuiper/xyz-certificate.pem

+ 11 - 12
xstream/extensions/mqtt_source.go

@@ -30,18 +30,17 @@ type MQTTSource struct {
 }
 
 type MQTTConfig struct {
-	Format             string   `json:"format"`
-	Qos                int      `json:"qos"`
-	Sharedsubscription bool     `json:"sharedSubscription"`
-	Servers            []string `json:"servers"`
-	Clientid           string   `json:"clientid"`
-	PVersion           string   `json:"protocolVersion"`
-	Uname              string   `json:"username"`
-	Password           string   `json:"password"`
-	Certification      string   `json:"certificationPath"`
-	PrivateKPath       string   `json:"privateKeyPath"`
-	KubeedgeModelFile  string   `json:"kubeedgeModelFile"`
-	KubeedgeVersion    string   `json:"kubeedgeVersion"`
+	Format            string   `json:"format"`
+	Qos               int      `json:"qos"`
+	Servers           []string `json:"servers"`
+	Clientid          string   `json:"clientid"`
+	PVersion          string   `json:"protocolVersion"`
+	Uname             string   `json:"username"`
+	Password          string   `json:"password"`
+	Certification     string   `json:"certificationPath"`
+	PrivateKPath      string   `json:"privateKeyPath"`
+	KubeedgeModelFile string   `json:"kubeedgeModelFile"`
+	KubeedgeVersion   string   `json:"kubeedgeVersion"`
 }
 
 func (ms *MQTTSource) WithSchema(schema string) *MQTTSource {