Skip to content

Commit 25ddd01

Browse files
committed
On 2nd thought: The framing encoding only allows for 16-bit integers for the channel number
1 parent 63c6ec4 commit 25ddd01

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ public synchronized ChannelN createChannel(AMQConnection connection, int channel
9898

9999
public synchronized int allocateChannelNumber(int maxChannels) {
100100
if (maxChannels == 0) {
101-
maxChannels = Integer.MAX_VALUE - 1;
101+
// The framing encoding only allows for 16-bit integers for the channel number
102+
maxChannels = Short.MAX_VALUE;
102103
}
103104
int channelNumber = -1;
104105
for (int candidate = 1; candidate <= maxChannels; candidate++) {

0 commit comments

Comments
 (0)