5051525354555657585960
client.publish("test", "hello".getBytes(), 1, false); Message msg = consumer.receive(100 * 5); assertNotNull(msg); client.disconnect(); client.close(); } }
8182838485868788899091
sendBarrier.await(); for( int i=0; i < 10; i++) { Thread.sleep(1000); client.publish("test", "hello".getBytes(), 1, false); } client.disconnect(); client.close(); } catch (Throwable e) { e.printStackTrace(); asyncError.set(e); } finally {
8687888990919293949596
} catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new IllegalStateException(e); } client.disconnect(); client.close(); } catch (MqttException mqttException) { throw new IllegalStateException(mqttException.getMessage()); }