diff --git a/udmis/src/main/java/com/google/bos/udmi/service/messaging/impl/MessageBase.java b/udmis/src/main/java/com/google/bos/udmi/service/messaging/impl/MessageBase.java index 99cab7dd79..11681ff426 100644 --- a/udmis/src/main/java/com/google/bos/udmi/service/messaging/impl/MessageBase.java +++ b/udmis/src/main/java/com/google/bos/udmi/service/messaging/impl/MessageBase.java @@ -530,7 +530,7 @@ public Bundle(Map attributes, Object message) { /** * Get the actual send bytes for this bundle, either from raw payload or message object. */ - public byte[] getSendBytes() { + public byte[] sendBytes() { checkState(message != null || payload != null, "no message or payload"); checkState(message == null || payload == null, "both message and payload"); return ofNullable(message).map(JsonUtil::stringifyTerse).orElse(payload).getBytes(); diff --git a/udmis/src/main/java/com/google/bos/udmi/service/messaging/impl/SimpleMqttPipe.java b/udmis/src/main/java/com/google/bos/udmi/service/messaging/impl/SimpleMqttPipe.java index 5864904f8c..5b1dd7f105 100644 --- a/udmis/src/main/java/com/google/bos/udmi/service/messaging/impl/SimpleMqttPipe.java +++ b/udmis/src/main/java/com/google/bos/udmi/service/messaging/impl/SimpleMqttPipe.java @@ -3,7 +3,6 @@ import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkState; import static com.google.udmi.util.GeneralUtils.friendlyStackTrace; -import static com.google.udmi.util.GeneralUtils.ifNotNullGet; import static com.google.udmi.util.GeneralUtils.ifNotNullThen; import static com.google.udmi.util.GeneralUtils.ifTrueThen; import static com.google.udmi.util.JsonUtil.toStringMap; @@ -13,7 +12,6 @@ import com.google.bos.udmi.service.messaging.MessagePipe; import com.google.common.base.Strings; import java.util.Map; -import java.util.Optional; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; @@ -145,7 +143,7 @@ private String makeBrokerUrl(EndpointConfiguration endpoint) { private MqttMessage makeMqttMessage(Bundle bundle) { MqttMessage message = new MqttMessage(); - message.setPayload(bundle.getSendBytes()); + message.setPayload(bundle.sendBytes()); return message; }