code: private static void publish(MqttSettings settings, String subtopic, byte[] payload, int qos, boolean retained) throws MqttException {
      getClient(settings).publish(String.format("%s/%s", settings.getTopic(), subtopic), payload, qos, retained);
    }
docs: Publishes message into given MQTT topic
  
  @param settings MQTT settings
  @param subtopic subtopic to deliver the message to.
  @param payload the byte array to use as the payload
  @param qos the Quality of Service to deliver the message at. Valid values are 0, 1 or 2.
  @param retained whether or not this message should be retained by the server.
  @throws MqttException thrown when MQTT client construction fails