Do not open WebMQTT connection in MQTT plugin
This commit is contained in:
		
							parent
							
								
									ddab3d523f
								
							
						
					
					
						commit
						f002029ebd
					
				| 
						 | 
				
			
			@ -85,12 +85,6 @@ run(Config) ->
 | 
			
		|||
    %% No connections
 | 
			
		||||
    [] = 'Elixir.Enum':to_list(?COMMAND:run([], Opts)),
 | 
			
		||||
 | 
			
		||||
    %% Open a WebMQTT connection, command won't list it
 | 
			
		||||
    WebMqttConfig = [{websocket, true} | Config],
 | 
			
		||||
    _C0 = connect(<<"simpleWebMqttClient">>, WebMqttConfig, [{ack_timeout, 1}]),
 | 
			
		||||
 | 
			
		||||
    [] = 'Elixir.Enum':to_list(?COMMAND:run([], Opts)),
 | 
			
		||||
 | 
			
		||||
    %% Open a connection
 | 
			
		||||
    C1 = connect(<<"simpleClient">>, Config, [{ack_timeout, 1}]),
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -16,6 +16,7 @@
 | 
			
		|||
        [connect/3, connect/4]).
 | 
			
		||||
 | 
			
		||||
-define(COMMAND, 'Elixir.RabbitMQ.CLI.Ctl.Commands.ListWebMqttConnectionsCommand').
 | 
			
		||||
-define(MQTT_COMMAND, 'Elixir.RabbitMQ.CLI.Ctl.Commands.ListMqttConnectionsCommand').
 | 
			
		||||
 | 
			
		||||
all() ->
 | 
			
		||||
    [
 | 
			
		||||
| 
						 | 
				
			
			@ -93,12 +94,16 @@ run(BaseConfig) ->
 | 
			
		|||
    [] = 'Elixir.Enum':to_list(?COMMAND:run([<<"client_id">>], Opts)),
 | 
			
		||||
 | 
			
		||||
    %% Open a WebMQTT connection
 | 
			
		||||
 | 
			
		||||
    C2 = connect(<<"simpleWebMqttClient">>, Config, [{ack_timeout, 1}]),
 | 
			
		||||
    timer:sleep(200),
 | 
			
		||||
 | 
			
		||||
    %% WebMQTT CLI should list only WebMQTT connection.
 | 
			
		||||
    [[{client_id, <<"simpleWebMqttClient">>}]] =
 | 
			
		||||
        'Elixir.Enum':to_list(?COMMAND:run([<<"client_id">>], Opts)),
 | 
			
		||||
    'Elixir.Enum':to_list(?COMMAND:run([<<"client_id">>], Opts)),
 | 
			
		||||
 | 
			
		||||
    %% MQTT CLI should list only MQTT connection.
 | 
			
		||||
    [[{client_id, <<"simpleMqttClient">>}]] =
 | 
			
		||||
    'Elixir.Enum':to_list(?MQTT_COMMAND:run([<<"client_id">>], Opts)),
 | 
			
		||||
 | 
			
		||||
    C3 = connect(<<"simpleWebMqttClient1">>, Config, [{ack_timeout, 1}]),
 | 
			
		||||
    timer:sleep(200),
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue