You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ChannelManager#createChannel can return null when it runs out of free channels, the JavaDoc of AMQConnection#createChannel also says it may return null.
The following code in createChannel() and createChannel(int channelNumber)
channel.addShutdownListener will fail with the NPE.
We've observed this through logs in one of our production services:
01-25 12:52:30 INFO c.r.c.impl.AbstractMetricsCollector - Error while computing metrics in newChannel: Cannot invoke "com.rabbitmq.client.Channel.addShutdownListener(com.rabbitmq.client.ShutdownListener)" because "channel" is null
The text was updated successfully, but these errors were encountered:
michaelklishin
changed the title
NPE in AbstractMetricsCollector
NPE in AbstractMetricsCollector when channel limit is exceeded
Jan 26, 2023
ChannelManager#createChannel
can return null when it runs out of free channels, the JavaDoc ofAMQConnection#createChannel
also says it may returnnull
.The following code in
createChannel()
andcreateChannel(int channelNumber)
rabbitmq-java-client/src/main/java/com/rabbitmq/client/impl/AMQConnection.java
Lines 598 to 600 in 4142f8d
leads to an NPE in
AbstractMetricsCollector#newChannel
:rabbitmq-java-client/src/main/java/com/rabbitmq/client/impl/AbstractMetricsCollector.java
Lines 85 to 87 in 4142f8d
channel.addShutdownListener
will fail with the NPE.We've observed this through logs in one of our production services:
The text was updated successfully, but these errors were encountered: