diff --git a/src/main/java/com/hivemq/client/internal/mqtt/message/publish/MqttPublishBuilder.java b/src/main/java/com/hivemq/client/internal/mqtt/message/publish/MqttPublishBuilder.java index 34b5f80fc..dcc895c5f 100644 --- a/src/main/java/com/hivemq/client/internal/mqtt/message/publish/MqttPublishBuilder.java +++ b/src/main/java/com/hivemq/client/internal/mqtt/message/publish/MqttPublishBuilder.java @@ -262,6 +262,8 @@ private static abstract class WillBase> extends MqttPublis super(publishBuilder); if (publishBuilder instanceof WillBase) { delayInterval = ((WillBase) publishBuilder).delayInterval; + } else { + payload(payload); // check payload size restriction } }