Skip to content

Commit

Permalink
Tweak error message
Browse files Browse the repository at this point in the history
References #1062

(cherry picked from commit 5982cd1)
  • Loading branch information
acogoluegnes committed Jun 15, 2023
1 parent 714aae6 commit 04f1801
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/main/java/com/rabbitmq/client/impl/CommandAssembler.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ private void consumeHeaderFrame(Frame f) throws IOException {
long bodySize = this.contentHeader.getBodySize();
if (bodySize >= this.maxBodyLength) {
throw new IllegalStateException(format(
"Message body is too large (%d), maximum size is %d",
"Message body is too large (%d), maximum configured size is %d. " +
"See ConnectionFactory#setMaxInboundMessageBodySize " +
"if you need to increase the limit.",
bodySize, this.maxBodyLength
));
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/rabbitmq/client/impl/Frame.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ public static Frame readFrom(DataInputStream is, int maxPayloadSize) throws IOEx
int payloadSize = is.readInt();
if (payloadSize >= maxPayloadSize) {
throw new IllegalStateException(format(
"Frame body is too large (%d), maximum size is %d",
"Frame body is too large (%d), maximum configured size is %d. " +
"See ConnectionFactory#setMaxInboundMessageBodySize " +
"if you need to increase the limit.",
payloadSize, maxPayloadSize
));
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/rabbitmq/client/impl/nio/FrameBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ public Frame readFrame() throws IOException {
int framePayloadSize = (frameBuffer[0] << 24) + (frameBuffer[1] << 16) + (frameBuffer[2] << 8) + readFromBuffer();
if (framePayloadSize >= maxPayloadSize) {
throw new IllegalStateException(format(
"Frame body is too large (%d), maximum size is %d",
"Frame body is too large (%d), maximum configured size is %d. " +
"See ConnectionFactory#setMaxInboundMessageBodySize " +
"if you need to increase the limit.",
framePayloadSize, maxPayloadSize
));
}
Expand Down

0 comments on commit 04f1801

Please sign in to comment.