Skip to content

Commit d4ce614

Browse files
committed
accomodate broker fudging
1 parent 26c5f8a commit d4ce614

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/com/rabbitmq/client/impl/AMQCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class AMQCommand implements Command {
4040
* See {@link #checkEmptyContentBodyFrameSize}, an assertion
4141
* checked at startup.
4242
*/
43-
private static final int EMPTY_CONTENT_BODY_FRAME_SIZE = 8;
43+
public static final int EMPTY_CONTENT_BODY_FRAME_SIZE = 8;
4444

4545
/** The assembler for this command - synchronised on - contains all the state */
4646
private final CommandAssembler assembler;

test/src/com/rabbitmq/client/test/functional/FrameMax.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import com.rabbitmq.client.ConnectionFactory;
3030
import com.rabbitmq.client.GetResponse;
3131
import com.rabbitmq.client.impl.AMQConnection;
32+
import com.rabbitmq.client.impl.AMQCommand;
3233
import com.rabbitmq.client.impl.Frame;
3334
import com.rabbitmq.client.impl.FrameHandler;
3435
import com.rabbitmq.client.impl.LongStringHelper;
@@ -150,7 +151,9 @@ public GenerousAMQConnection(ConnectionFactory factory,
150151
}
151152

152153
@Override public int getFrameMax() {
153-
return super.getFrameMax() + 1;
154+
// the RabbitMQ broker permits frames that are oversize by
155+
// up to EMPTY_CONTENT_BODY_FRAME_SIZE octets
156+
return super.getFrameMax() + AMQCommand.EMPTY_CONTENT_BODY_FRAME_SIZE + 1;
154157
}
155158

156159
}

0 commit comments

Comments
 (0)