diff --git a/node-api/src/main/kotlin/net/corda/nodeapi/internal/protonwrapper/netty/AMQPChannelHandler.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/protonwrapper/netty/AMQPChannelHandler.kt index 1be1b652f3..e39e263df6 100644 --- a/node-api/src/main/kotlin/net/corda/nodeapi/internal/protonwrapper/netty/AMQPChannelHandler.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/protonwrapper/netty/AMQPChannelHandler.kt @@ -15,6 +15,7 @@ import io.netty.channel.ChannelDuplexHandler import io.netty.channel.ChannelHandlerContext import io.netty.channel.ChannelPromise import io.netty.channel.socket.SocketChannel +import io.netty.handler.proxy.ProxyConnectException import io.netty.handler.proxy.ProxyConnectionEvent import io.netty.handler.ssl.SslHandler import io.netty.handler.ssl.SslHandshakeCompletionEvent @@ -131,6 +132,10 @@ internal class AMQPChannelHandler(private val serverMode: Boolean, if (log.isTraceEnabled) { log.trace("Pipeline uncaught exception", cause) } + if (cause is ProxyConnectException) { + log.warn("Proxy connection failed ${cause.message}") + suppressClose = true // The pipeline gets marked as active on connection to the proxy rather than to the target, which causes excess close events + } ctx.close() }