broker/test/MessageCollector: code formatter used
This commit is contained in:
@@ -13,12 +13,12 @@
|
||||
*
|
||||
* You may elect to redistribute this code under either of these licenses.
|
||||
*/
|
||||
|
||||
package io.moquette.server;
|
||||
|
||||
import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken;
|
||||
import org.eclipse.paho.client.mqttv3.MqttCallback;
|
||||
import org.eclipse.paho.client.mqttv3.MqttMessage;
|
||||
|
||||
import java.util.concurrent.*;
|
||||
|
||||
/**
|
||||
@@ -27,6 +27,7 @@ import java.util.concurrent.*;
|
||||
public class MessageCollector implements MqttCallback {
|
||||
|
||||
private class ReceivedMessage {
|
||||
|
||||
private final MqttMessage message;
|
||||
private final String topic;
|
||||
|
||||
@@ -41,7 +42,7 @@ public class MessageCollector implements MqttCallback {
|
||||
|
||||
/**
|
||||
* Return the message from the queue if not empty, else return null with wait period.
|
||||
* */
|
||||
*/
|
||||
public MqttMessage getMessageImmediate() {
|
||||
if (m_messages.isEmpty()) {
|
||||
return null;
|
||||
@@ -94,13 +95,13 @@ public class MessageCollector implements MqttCallback {
|
||||
|
||||
/**
|
||||
* Invoked when the message sent to a server is ACKED (PUBACK or PUBCOMP by the server)
|
||||
* */
|
||||
*/
|
||||
@Override
|
||||
public void deliveryComplete(IMqttDeliveryToken token) {
|
||||
// try {
|
||||
// m_messages.offer(new ReceivedMessage(token.waitMessage(), token.getTopics()[0]));
|
||||
// } catch (MqttException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// try {
|
||||
// m_messages.offer(new ReceivedMessage(token.waitMessage(), token.getTopics()[0]));
|
||||
// } catch (MqttException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user