@Override
 protected void stop() {
   if (consumer != null) {
     consumer.disconnectCommandPort();
     consumer = null;
   }
 }
  @Override
  protected void start() {
    // stop the producer if we are not stopped already
    if (consumer != null) stop();

    int serverPortInt = NumberUtils.toInt(serverPort.getText(), DEFAULT_SERVER_PORT);
    switch (protocol.getValue()) {
      case TCP:
        consumer = new TcpEventConsumer();
        break;
      case TCP_SERVER:
        consumer = new TcpServerEventConsumer(serverPortInt);
        break;
      case WEBSOCKETS:
        consumer = new WebsocketEventConsumer();
        break;
      case WEBSOCKET_SERVER:
        consumer = new WebsocketServerEventConsumer(serverPortInt);
        break;
      case ACTIVE_MQ:
        consumer = new ActiveMQEventConsumer();
        break;
      case RABBIT_MQ:
        consumer = new RabbitMQEventConsumer();
        break;
      case STREAM_SERVICE:
        consumer = new StreamServiceEventConsumer();
        break;
      case KAFKA:
        consumer = new KafkaEventConsumer();
        break;
      default:
        return;
    }

    int portNumber = NumberUtils.toInt(port.getText(), DEFAULT_COMMAND_PORT);
    consumer.listenOnCommandPort(portNumber, true);
  }