title: MQTT with JAVA- When publish some data with QoS1 I lose some data
body: <p>I am working on my MQTT project and I am a beginner at this. I want to publish some data with all QoS levels and subscribe to them and doing time measurements. I am using a Raspberry pi as a Subscriber and also I am using Mosquitto broker in same Raspberry pi. I am publishing data with my own laptop. I was expecting that when I publish and subscribe data with Qos 0, I would lose some data but my subscriber received all the data. By the way, I published 10million random values with 8 parallel thread without any <code>thread.sleep()</code>. These are part of my publisher codes:</p>
  <pre><code>final String temperature = tempratureNumber + &quot;°C&quot;; //temperatureNumber is random value.
  byte[] payload = temperature.getBytes();  
  tempratureBadroomTopic.publish(payload,1,true);
  
  //And these are my connect options:
  MqttConnectOptions options = new MqttConnectOptions();
  options.setCleanSession(false);
  options.setWill(client.getTopic(&quot;home/LWT&quot;), &quot;I'm gone :(&quot;.getBytes(), 1, false);
  options.setMaxInflight(32768); // for too many publishes error.
  client.connect(options);
  </code></pre>
  <p>Also these are part of my Subscriber codes:</p>
  <pre><code>final String topic1 = &quot;home/brightness1/bathroom&quot;;
  mqttClient.subscribe(topic1,1);
  </code></pre>
  <p>Also, I was expecting that, when I publish 200k random values with QoS1, it will take more time but I will receive at least 200k random values may be more than 200k because of QoS level. However, sometimes I received less than 200k values e.g 199780. I can't understand why I am losing data.
  What could be the reason for these situations I encountered?
  Have a good day.</p>