"Channel shutdown: connection error"

Martin

I've set up on AWS a RabbitMQ cluster with two nodes, and enabled HA as described here. Then, I set up an Elastic Load Balancer mapping 5672 to the instances' 5672 port, with a periodic health check to the instances' 15672 port (the HTTP management port). Then, I started two listeners (one in each node), each one with 4 consumers, and pointed spring.rabbitmq.host at the load balancer's DNS. However, I'm periodically getting the following errors:

[E] [2015-03-14 23:13:23,890] [pool-4-thread-9         ] [CachingConnectionFactory        ] [                                    ] Channel shutdown: connection error
[E] [2015-03-14 23:13:23,891] [pool-4-thread-9         ] [CachingConnectionFactory        ] [                                    ] Channel shutdown: connection error
[E] [2015-03-14 23:13:23,891] [pool-4-thread-9         ] [CachingConnectionFactory        ] [                                    ] Channel shutdown: connection error
[E] [2015-03-14 23:13:23,891] [pool-4-thread-9         ] [CachingConnectionFactory        ] [                                    ] Channel shutdown: connection error
[W] [2015-03-14 23:13:24,758] [impleAsyncTaskExecutor-5] [SimpleMessageListenerContainer  ] [                                    ] Consumer raised exception, processing can restart if the connection factory supports it
com.rabbitmq.client.ShutdownSignalException: connection error
    at com.rabbitmq.client.impl.AMQConnection.startShutdown(AMQConnection.java:717) ~[amqp-client-3.4.2.jar!/:?]
    at com.rabbitmq.client.impl.AMQConnection.shutdown(AMQConnection.java:707) ~[amqp-client-3.4.2.jar!/:?]
    at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:565) ~[amqp-client-3.4.2.jar!/:?]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_40]
Caused by: java.io.EOFException
    at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:290) ~[?:1.8.0_40]
    at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:95) ~[amqp-client-3.4.2.jar!/:?]
    at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:139) ~[amqp-client-3.4.2.jar!/:?]
    at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:534) ~[amqp-client-3.4.2.jar!/:?]
    ... 1 more
[I] [2015-03-14 23:13:24,761] [impleAsyncTaskExecutor-5] [SimpleMessageListenerContainer  ] [                                    ] Restarting Consumer: tags=[[amq.ctag-H-1ed6xO3GL7qW58bkLUZA]], channel=Cached Rabbit Channel: AMQChannel(amqp://[email protected]:5672qube,1), acknowledgeMode=AUTO local queue size=0
[W] [2015-03-14 23:13:24,762] [impleAsyncTaskExecutor-8] [SimpleMessageListenerContainer  ] [                                    ] Consumer raised exception, processing can restart if the connection factory supports it
com.rabbitmq.client.ShutdownSignalException: connection error
    at com.rabbitmq.client.impl.AMQConnection.startShutdown(AMQConnection.java:717) ~[amqp-client-3.4.2.jar!/:?]
    at com.rabbitmq.client.impl.AMQConnection.shutdown(AMQConnection.java:707) ~[amqp-client-3.4.2.jar!/:?]
    at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:565) ~[amqp-client-3.4.2.jar!/:?]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_40]
Caused by: java.io.EOFException
    at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:290) ~[?:1.8.0_40]
    at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:95) ~[amqp-client-3.4.2.jar!/:?]
    at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:139) ~[amqp-client-3.4.2.jar!/:?]
    at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:534) ~[amqp-client-3.4.2.jar!/:?]
    ... 1 more
[I] [2015-03-14 23:13:24,762] [impleAsyncTaskExecutor-8] [SimpleMessageListenerContainer  ] [                                    ] Restarting Consumer: tags=[[amq.ctag-nJAmieDx-kSuxl9arsXiww]], channel=Cached Rabbit Channel: AMQChannel(amqp://[email protected]:5672qube,2), acknowledgeMode=AUTO local queue size=0
[W] [2015-03-14 23:13:24,767] [impleAsyncTaskExecutor-7] [SimpleMessageListenerContainer  ] [                                    ] Consumer raised exception, processing can restart if the connection factory supports it
com.rabbitmq.client.ShutdownSignalException: connection error
    at com.rabbitmq.client.impl.AMQConnection.startShutdown(AMQConnection.java:717) ~[amqp-client-3.4.2.jar!/:?]
    at com.rabbitmq.client.impl.AMQConnection.shutdown(AMQConnection.java:707) ~[amqp-client-3.4.2.jar!/:?]
    at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:565) ~[amqp-client-3.4.2.jar!/:?]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_40]
Caused by: java.io.EOFException
    at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:290) ~[?:1.8.0_40]
    at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:95) ~[amqp-client-3.4.2.jar!/:?]
    at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:139) ~[amqp-client-3.4.2.jar!/:?]
    at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:534) ~[amqp-client-3.4.2.jar!/:?]
    ... 1 more
[I] [2015-03-14 23:13:24,768] [impleAsyncTaskExecutor-7] [SimpleMessageListenerContainer  ] [                                    ] Restarting Consumer: tags=[[amq.ctag-PAQvN8P57_9oiElyqYRJWw]], channel=Cached Rabbit Channel: AMQChannel(amqp://[email protected]:5672qube,3), acknowledgeMode=AUTO local queue size=0
[W] [2015-03-14 23:13:24,768] [impleAsyncTaskExecutor-6] [SimpleMessageListenerContainer  ] [                                    ] Consumer raised exception, processing can restart if the connection factory supports it
com.rabbitmq.client.ShutdownSignalException: connection error
    at com.rabbitmq.client.impl.AMQConnection.startShutdown(AMQConnection.java:717) ~[amqp-client-3.4.2.jar!/:?]
    at com.rabbitmq.client.impl.AMQConnection.shutdown(AMQConnection.java:707) ~[amqp-client-3.4.2.jar!/:?]
    at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:565) ~[amqp-client-3.4.2.jar!/:?]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_40]
Caused by: java.io.EOFException
    at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:290) ~[?:1.8.0_40]
    at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:95) ~[amqp-client-3.4.2.jar!/:?]
    at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:139) ~[amqp-client-3.4.2.jar!/:?]
    at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:534) ~[amqp-client-3.4.2.jar!/:?]
    ... 1 more
[I] [2015-03-14 23:13:24,769] [impleAsyncTaskExecutor-6] [SimpleMessageListenerContainer  ] [                                    ] Restarting Consumer: tags=[[amq.ctag-w6apIlL78ViAnTOzx2Qejg]], channel=Cached Rabbit Channel: AMQChannel(amqp://[email protected]:5672qube,4), acknowledgeMode=AUTO local queue size=0

This does not happen if I point each consumer directly at one node (without using the load balancer). What can be causing this behaviout? How can I circumvent this?

Gary Russell

Pinging the admin port will do nothing to keep the amqp connection(s) alive.

You need to configure heartbeats to a low enough value to prevent the load balancer from dropping an "idle" connection.

It looks like you might be using Spring Boot (based on the property name) and it doesn't currently expose requestedHeartbeats as a property; you will need to override the boot factory by wiring up your own rabbitConnectionFactory bean with the underlying rabbitmq connection factory heartbeat settings. See the documentation for details.

That said, there is no benefit gained from using a load balancer with Spring AMQP because it uses a single long-lived connection. Consider configuring your two instances in the addresses property instead and it will fail over to the second instance if the first is not available.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Merging Users in Kinvey

From Dev

PostgreSQL: Efficiently split JSON array into rows

From Dev

boost::asio how to read full buffer in right way?

From Dev

GIT SVN: fetching a recreated SVN branch without the wrong merge parent

From Dev

How to find out value of a particular attribute index in core data model iOS

From Dev

iOS - iPad preview in Xcode is missing

From Dev

Java: Method hooking & Finding object instances

From Dev

Using git diff, how can I show the patch from the index to a given commit?

From Dev

Cast for upcasting only

From Dev

How can I multiply or divide value under the cursor by a repeat count?

From Dev

Can`t compile boost spirit word_count_lexer example

From Java

How to make a for loop variable const with the exception of the increment statement?

From Java

Count letters in a text in the Welsh language

From Java

Why does using the ternary operator to return a string generate considerably different code from returning in an equivalent if/else block?

From Java

No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp() in Flutter and Firebase

From Java

Changes using mutable reference of a field are not reflected after move of the original instance

From Java

Elastic Search indexes gets deleted frequently

From Java

Forgot do in do... while loop

From Java

How to fix "An unexpected error occurred. Please try again later. (7100000)" error in Google Play Console?

From Java

Does C# perform short circuit evaluation of if statements with await?

From Java

Why doesn't Python give any error when quotes around a string do not match?

From Java

Why is this regular expression so slow in Java?

From Java

Why are my two tuples containing strings, created the same way, not equal?

From Java

How to pass array initialization thru custom structure?

From Java

Why does Python code run faster in a function?

From Java

How to set same alignment for these two text

From Java

How to wrap title on to new line react native

From Dev

Run grunt task asynchronously before another task

From Dev

Bootstrap 3: Scroll bars

Related Related

  1. 1

    Merging Users in Kinvey

  2. 2

    PostgreSQL: Efficiently split JSON array into rows

  3. 3

    boost::asio how to read full buffer in right way?

  4. 4

    GIT SVN: fetching a recreated SVN branch without the wrong merge parent

  5. 5

    How to find out value of a particular attribute index in core data model iOS

  6. 6

    iOS - iPad preview in Xcode is missing

  7. 7

    Java: Method hooking & Finding object instances

  8. 8

    Using git diff, how can I show the patch from the index to a given commit?

  9. 9

    Cast for upcasting only

  10. 10

    How can I multiply or divide value under the cursor by a repeat count?

  11. 11

    Can`t compile boost spirit word_count_lexer example

  12. 12

    How to make a for loop variable const with the exception of the increment statement?

  13. 13

    Count letters in a text in the Welsh language

  14. 14

    Why does using the ternary operator to return a string generate considerably different code from returning in an equivalent if/else block?

  15. 15

    No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp() in Flutter and Firebase

  16. 16

    Changes using mutable reference of a field are not reflected after move of the original instance

  17. 17

    Elastic Search indexes gets deleted frequently

  18. 18

    Forgot do in do... while loop

  19. 19

    How to fix "An unexpected error occurred. Please try again later. (7100000)" error in Google Play Console?

  20. 20

    Does C# perform short circuit evaluation of if statements with await?

  21. 21

    Why doesn't Python give any error when quotes around a string do not match?

  22. 22

    Why is this regular expression so slow in Java?

  23. 23

    Why are my two tuples containing strings, created the same way, not equal?

  24. 24

    How to pass array initialization thru custom structure?

  25. 25

    Why does Python code run faster in a function?

  26. 26

    How to set same alignment for these two text

  27. 27

    How to wrap title on to new line react native

  28. 28

    Run grunt task asynchronously before another task

  29. 29

    Bootstrap 3: Scroll bars

HotTag

Archive