我一直试图在启用了ssl的docker中运行的兔子MQ上发送和接收消息。我首先得到一个没有ssl的Spring启动应用程序。随着一切在localhost上运行,我成功地使用dockerized rabbit MQ发送和接收消息。但现在,在dockerized rabbit MQ中启用ssl auth插件后,我收到一条声称的奇怪消息
o.s.a.r.l.SimpleMessageListenerContainer : Failed to check/redeclare auto-delete queue(s).
当我通过Web控制台查看dockerized rabbit实例时,我发现根本没有队列。如果我停止并重新启动容器,我会得到相同的结果。
的建议将兔子MQ指向此配置配置文件如下所示:
%% -*- mode: erlang -*- [ {rabbit, [ {ssl_listeners, [5671]}, {ssl_options, [{cacertfile,"/home/callen/.ssh/private_key.pem"}, {certfile,"/home/callen/.ssh/private_key.pem"}, {keyfile,"/home/callen/.ssh/public_key.pem"}, {verify,verify_none}, {fail_if_no_peer_cert,false}]} ]} ].
以下是Spring启动应用程序的堆栈跟踪:
2018-01-11 11:12:57.395 INFO 17786 --- [ main] n.k.r.r.RabbitConsumerApplicationTests : Starting RabbitConsumerApplicationTests on localhost.localdomain with PID 17786 (started by callen in /home/callen/Projects/rabbit-consumer) 2018-01-11 11:12:57.396 INFO 17786 --- [ main] n.k.r.r.RabbitConsumerApplicationTests : No active profile set, falling back to default profiles: default 2018-01-11 11:12:57.482 INFO 17786 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@36b4fe2a: startup date [Thu Jan 11 11:12:57 EST 2018]; root of context hierarchy 2018-01-11 11:12:58.351 INFO 17786 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.amqp.rabbit.annotation.RabbitBootstrapConfiguration' of type [org.springframework.amqp.rabbit.annotation.RabbitBootstrapConfiguration$$EnhancerBySpringCGLIB$$3062a902] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2018-01-11 11:12:59.423 INFO 17786 --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase 2147483647 2018-01-11 11:12:59.529 ERROR 17786 --- [ container-1] o.s.a.r.l.SimpleMessageListenerContainer : Failed to check/redeclare auto-delete queue(s). org.springframework.amqp.AmqpIOException: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake at org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:71) ~[spring-rabbit-1.7.4.RELEASE.jar:na] at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:368) ~[spring-rabbit-1.7.4.RELEASE.jar:na] at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:573) ~[spring-rabbit-1.7.4.RELEASE.jar:na] at org.springframework.amqp.rabbit.core.RabbitTemplate.doExecute(RabbitTemplate.java:1430) ~[spring-rabbit-1.7.4.RELEASE.jar:na] at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:1411) ~[spring-rabbit-1.7.4.RELEASE.jar:na] at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:1387) ~[spring-rabbit-1.7.4.RELEASE.jar:na] at org.springframework.amqp.rabbit.core.RabbitAdmin.getQueueProperties(RabbitAdmin.java:336) ~[spring-rabbit-1.7.4.RELEASE.jar:na] at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.redeclareElementsIfNecessary(SimpleMessageListenerContainer.java:1171) ~[spring-rabbit-1.7.4.RELEASE.jar:na] at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1422) [spring-rabbit-1.7.4.RELEASE.jar:na] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_151] Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1002) ~[na:1.8.0_151] at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385) ~[na:1.8.0_151] at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:757) ~[na:1.8.0_151] at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:123) ~[na:1.8.0_151] at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82) ~[na:1.8.0_151] at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140) ~[na:1.8.0_151] at java.io.DataOutputStream.flush(DataOutputStream.java:123) ~[na:1.8.0_151] at com.rabbitmq.client.impl.SocketFrameHandler.sendHeader(SocketFrameHandler.java:147) ~[amqp-client-4.0.3.jar:4.0.3] at com.rabbitmq.client.impl.SocketFrameHandler.sendHeader(SocketFrameHandler.java:153) ~[amqp-client-4.0.3.jar:4.0.3] at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:285) ~[amqp-client-4.0.3.jar:4.0.3] at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:909) ~[amqp-client-4.0.3.jar:4.0.3] at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:859) ~[amqp-client-4.0.3.jar:4.0.3] at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:799) ~[amqp-client-4.0.3.jar:4.0.3] at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:352) ~[spring-rabbit-1.7.4.RELEASE.jar:na] ... 8 common frames omitted Caused by: java.io.EOFException: SSL peer shut down incorrectly at sun.security.ssl.InputRecord.read(InputRecord.java:505) ~[na:1.8.0_151] at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983) ~[na:1.8.0_151] ... 21 common frames omitted
你说什么,好人?