String payload = "Test Message: " + i;
connection.publish("foo", payload.getBytes(), QoS.AT_MOST_ONCE, false);
Message message = connection.receive();
assertEquals(payload, new String(message.getPayload()));
}
connection.disconnect();
}
@Test
public void testSendAndReceiveAtLeastOnce() throws Exception {
addMQTTConnector(brokerService);