Skip to content

Commit 05f0fd6

Browse files
committed
Tweak error message
References #1062 (cherry picked from commit 5982cd1)
1 parent 97590ab commit 05f0fd6

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/main/java/com/rabbitmq/client/impl/CommandAssembler.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ private void consumeHeaderFrame(Frame f) throws IOException {
107107
long bodySize = this.contentHeader.getBodySize();
108108
if (bodySize >= this.maxBodyLength) {
109109
throw new IllegalStateException(format(
110-
"Message body is too large (%d), maximum size is %d",
110+
"Message body is too large (%d), maximum configured size is %d. " +
111+
"See ConnectionFactory#setMaxInboundMessageBodySize " +
112+
"if you need to increase the limit.",
111113
bodySize, this.maxBodyLength
112114
));
113115
}

src/main/java/com/rabbitmq/client/impl/Frame.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ public static Frame readFrom(DataInputStream is, int maxPayloadSize) throws IOEx
112112
int payloadSize = is.readInt();
113113
if (payloadSize >= maxPayloadSize) {
114114
throw new IllegalStateException(format(
115-
"Frame body is too large (%d), maximum size is %d",
115+
"Frame body is too large (%d), maximum configured size is %d. " +
116+
"See ConnectionFactory#setMaxInboundMessageBodySize " +
117+
"if you need to increase the limit.",
116118
payloadSize, maxPayloadSize
117119
));
118120
}

src/main/java/com/rabbitmq/client/impl/nio/FrameBuilder.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ public Frame readFrame() throws IOException {
9898
int framePayloadSize = (frameBuffer[0] << 24) + (frameBuffer[1] << 16) + (frameBuffer[2] << 8) + readFromBuffer();
9999
if (framePayloadSize >= maxPayloadSize) {
100100
throw new IllegalStateException(format(
101-
"Frame body is too large (%d), maximum size is %d",
101+
"Frame body is too large (%d), maximum configured size is %d. " +
102+
"See ConnectionFactory#setMaxInboundMessageBodySize " +
103+
"if you need to increase the limit.",
102104
framePayloadSize, maxPayloadSize
103105
));
104106
}

0 commit comments

Comments
 (0)