Skip to content

Commit 04f1801

Browse files
committed
Tweak error message
References #1062 (cherry picked from commit 5982cd1)
1 parent 714aae6 commit 04f1801

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

+3-1
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

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

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

+3-1
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)