code: public void publish(int qos, String payload) throws ArtikCloudMqttException {
          MqttMessage mqttMessage = new MqttMessage(payload.getBytes());
          mqttMessage.setQos(qos);
  //        System.out.println("****** Thread: " + Thread.currentThread().getName()+ "; MqttSession publishing : "+ "topic: " + publishTopic +"; payload: " + payload);
          try {
              mqttClient.publish(publishMessageTopicPath, mqttMessage, String.valueOf(OperationMode.PUBLISH), operationListener);
          } catch (MqttException e) {
              throw new ArtikCloudMqttException(e);
          }
      }
docs: @param qos Quality of Service (0, 1, or 2) used for publishing a message to ARTIK Cloud
  @param payload the payload of the published message
  @throws ArtikCloudMqttException