AWS中的RabbitMQ java客户端负载均衡

时间:2016-04-19 10:04:26

标签: java amazon-web-services rabbitmq amazon-elb

我们正在使用Amazon ELB for HA与RabbitMQ(3.2.4)和客户端(java spring rabbitmq)。 如果我们将java客户端连接到兔节点就可以了。 如果我们使用ELB作为端点,则每隔约10-60秒就会有一个新连接。

PS:

我们使用的默认ELB空闲连接超时为60秒: http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/config-idle-timeout.html

错误记录:

2016-04-19 09:14:11|Thread-13|[]|ERROR|com.reporter.message.broker.rabbit.consumer.EventProcessor:Connection failed
com.rabbitmq.client.AlreadyClosedException: connection is already closed due to connection error; cause: java.io.EOFException
        at com.rabbitmq.client.impl.AMQChannel.processShutdownSignal(AMQChannel.java:283) ~[amqp-client-3.5.7.jar:?]
        at com.rabbitmq.client.impl.ChannelN.startProcessShutdownSignal(ChannelN.java:267) ~[amqp-client-3.5.7.jar:?]
        at com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:573) ~[amqp-client-3.5.7.jar:?]
        at com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:509) ~[amqp-client-3.5.7.jar:?]
        at com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:503) ~[amqp-client-3.5.7.jar:?]
        at com.rabbitmq.client.impl.recovery.AutorecoveringChannel.close(AutorecoveringChannel.java:62) ~[amqp-client-3.5.7.jar:?]
        at com.reporter.message.broker.rabbit.consumer.EventProcessor.internalReceiveCycle(EventProcessor.java:89) ~[rabbit-1.1.0-CP-SNAPSHOT.jar:?]
        at com.reporter.message.broker.rabbit.consumer.EventProcessor.processMessages(EventProcessor.java:50) ~[rabbit-1.1.0-CP-SNAPSHOT.jar:?]
        at com.reporter.message.broker.rabbit.EventListenerServer.lambda$startProcessing$0(EventListenerServer.java:74) ~[rabbit-1.1.0-CP-SNAPSHOT.jar:?]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_72-internal]
2016-04-19 09:14:11|Thread-10|[]|ERROR|com.reporter.message.broker.rabbit.consumer.EventProcessor:Connection failed
com.rabbitmq.client.AlreadyClosedException: connection is already closed due to connection error; cause: java.io.EOFException
        at com.rabbitmq.client.impl.AMQChannel.processShutdownSignal(AMQChannel.java:283) ~[amqp-client-3.5.7.jar:?]
        at com.rabbitmq.client.impl.ChannelN.startProcessShutdownSignal(ChannelN.java:267) ~[amqp-client-3.5.7.jar:?]
        at com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:573) ~[amqp-client-3.5.7.jar:?]
        at com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:509) ~[amqp-client-3.5.7.jar:?]
        at com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:503) ~[amqp-client-3.5.7.jar:?]
        at com.rabbitmq.client.impl.recovery.AutorecoveringChannel.close(AutorecoveringChannel.java:62) ~[amqp-client-3.5.7.jar:?]
        at com.reporter.message.broker.rabbit.consumer.EventProcessor.internalReceiveCycle(EventProcessor.java:89) ~[rabbit-1.1.0-CP-SNAPSHOT.jar:?]
        at com.reporter.message.broker.rabbit.consumer.EventProcessor.processMessages(EventProcessor.java:50) ~[rabbit-1.1.0-CP-SNAPSHOT.jar:?]
        at com.reporter.message.broker.rabbit.EventListenerServer.lambda$startProcessing$0(EventListenerServer.java:74) ~[rabbit-1.1.0-CP-SNAPSHOT.jar:?]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_72-internal]
2016-04-19 09:14:11|Thread-20|[]|ERROR|com.reporter.message.broker.rabbit.consumer.EventProcessor:Connection failed
com.rabbitmq.client.AlreadyClosedException: connection is already closed due to connection error; cause: java.io.EOFException
        at com.rabbitmq.client.impl.AMQChannel.processShutdownSignal(AMQChannel.java:283) ~[amqp-client-3.5.7.jar:?]
        at com.rabbitmq.client.impl.ChannelN.startProcessShutdownSignal(ChannelN.java:267) ~[amqp-client-3.5.7.jar:?]
        at com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:573) ~[amqp-client-3.5.7.jar:?]
        at com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:509) ~[amqp-client-3.5.7.jar:?]
        at com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:503) ~[amqp-client-3.5.7.jar:?]
        at com.rabbitmq.client.impl.recovery.AutorecoveringChannel.close(AutorecoveringChannel.java:62) ~[amqp-client-3.5.7.jar:?]
        at com.reporter.message.broker.rabbit.consumer.EventProcessor.internalReceiveCycle(EventProcessor.java:89) ~[rabbit-1.1.0-CP-SNAPSHOT.jar:?]
        at com.reporter.message.broker.rabbit.consumer.EventProcessor.processMessages(EventProcessor.java:50) ~[rabbit-1.1.0-CP-SNAPSHOT.jar:?]
        at com.reporter.message.broker.rabbit.EventListenerServer.lambda$startProcessing$0(EventListenerServer.java:74) ~[rabbit-1.1.0-CP-SNAPSHOT.jar:?]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_72-internal]
2016-04-19 09:14:11|Thread-17|[]|ERROR|com.reporter.message.broker.rabbit.consumer.EventProcessor:Connection failed
com.rabbitmq.client.AlreadyClosedException: connection is already closed due to connection error; cause: java.io.EOFException
        at com.rabbitmq.client.impl.AMQChannel.processShutdownSignal(AMQChannel.java:283) ~[amqp-client-3.5.7.jar:?]
        at com.rabbitmq.client.impl.ChannelN.startProcessShutdownSignal(ChannelN.java:267) ~[amqp-client-3.5.7.jar:?]
        at com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:573) ~[amqp-client-3.5.7.jar:?]
        at com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:509) ~[amqp-client-3.5.7.jar:?]
        at com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:503) ~[amqp-client-3.5.7.jar:?]
        at com.rabbitmq.client.impl.recovery.AutorecoveringChannel.close(AutorecoveringChannel.java:62) ~[amqp-client-3.5.7.jar:?]
        at com.reporter.message.broker.rabbit.consumer.EventProcessor.internalReceiveCycle(EventProcessor.java:89) ~[rabbit-1.1.0-CP-SNAPSHOT.jar:?]
        at com.reporter.message.broker.rabbit.consumer.EventProcessor.processMessages(EventProcessor.java:50) ~[rabbit-1.1.0-CP-SNAPSHOT.jar:?]
        at com.reporter.message.broker.rabbit.EventListenerServer.lambda$startProcessing$0(EventListenerServer.java:74) ~[rabbit-1.1.0-CP-SNAPSHOT.jar:?]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_72-internal]

0 个答案:

没有答案