diff --git a/examples/features/standard/interceptor-client-mqtt/src/main/java/org/apache/activemq/artemis/mqtt/example/InterceptorExample.java b/examples/features/standard/interceptor-client-mqtt/src/main/java/org/apache/activemq/artemis/mqtt/example/InterceptorExample.java index 4fb5abf530..e72c93f794 100644 --- a/examples/features/standard/interceptor-client-mqtt/src/main/java/org/apache/activemq/artemis/mqtt/example/InterceptorExample.java +++ b/examples/features/standard/interceptor-client-mqtt/src/main/java/org/apache/activemq/artemis/mqtt/example/InterceptorExample.java @@ -54,7 +54,7 @@ public class InterceptorExample { // Receive the sent message Message message1 = connection.receive(5, TimeUnit.SECONDS); - + String messagePayload = new String(message1.getPayload(), StandardCharsets.UTF_8); System.out.println("Received message: " + messagePayload); diff --git a/examples/features/standard/interceptor-client-mqtt/src/main/java/org/apache/activemq/artemis/mqtt/example/SimpleMQTTInterceptor.java b/examples/features/standard/interceptor-client-mqtt/src/main/java/org/apache/activemq/artemis/mqtt/example/SimpleMQTTInterceptor.java index 1b7b482e22..c705b81865 100644 --- a/examples/features/standard/interceptor-client-mqtt/src/main/java/org/apache/activemq/artemis/mqtt/example/SimpleMQTTInterceptor.java +++ b/examples/features/standard/interceptor-client-mqtt/src/main/java/org/apache/activemq/artemis/mqtt/example/SimpleMQTTInterceptor.java @@ -51,8 +51,7 @@ public class SimpleMQTTInterceptor implements MQTTInterceptor { String modifiedMessage = "Modified message "; message.payload().setBytes(0, modifiedMessage.getBytes()); - } - else { + } else { if (mqttMessage instanceof MqttConnectMessage) { MqttConnectMessage connectMessage = (MqttConnectMessage) mqttMessage; System.out.println("A MQTT CONNECT control packet was intercepted " + connectMessage);