code: static void subscribe(IMqttClient mqttClient, MqttListenerDefinition listenerDefinition) throws MqttException {
          String[] topicFiler = listenerDefinition.getTopicFilter();
          int[] qos = listenerDefinition.getQos();
          mqttClient.subscribe(topicFiler, qos);
          // Fix PAHO bug: Test all qos values to throw an exception if one subscribe is not correct.
          // the qos tab is updated if a subscribe is failed but test is only on the first item of the list.
          for (int j = 0; j < qos.length; j++) {
              if (qos[j] == 0x80) {
                  throw SeedException.wrap(new MqttException(MqttException.REASON_CODE_SUBSCRIBE_FAILED), MqttErrorCode.SUBSCRIBE_FAILED)
                          .put("topic", topicFiler[j]);
              }
          }
      }
docs: Subscribe a {@link MqttClient} to topics.
  
  @param mqttClient         {@link MqttClient} used for subscription.
  @param listenerDefinition {@link MqttListenerDefinition} which contains all topics
  definition
  @throws MqttException if client can not connect to the broker.