Spring Cloud Data Flow Local Server无法连接到RabbitMQ

时间:2019-01-09 09:13:30

标签: rabbitmq spring-cloud-dataflow

我正在尝试遵循SCDF参考指南的Deploying Streams。我可以注册应用并创建流:

Welcome to the Spring Cloud Data Flow shell. For assistance hit TAB or type "help".                                                  
dataflow:>app register --name http --type source --uri maven://org.springframework.cloud.stream.app:http-source-rabbit:1.2.0.RELEASE 
Successfully registered application 'source:http'                                                                                    
dataflow:>app register --name log --type sink --uri maven://org.springframework.cloud.stream.app:log-sink-rabbit:1.1.0.RELEASE       
Successfully registered application 'sink:log'                                                                                       
dataflow:>stream create --name httptest --definition "http --server.port=9000 | log" --deploy                                        
Created new stream 'httptest'                                                                                                        
Deployment request has been sent                                                                                                     
dataflow:>                                                                                                                           

但是,应用程序无法连接到RabbitMq。

httptest.log的日志显示:

...
2019-01-09 08:34:00.831  INFO 11492 --- [           main] o.s.c.s.a.l.s.r.LogSinkRabbitApplication : No active profile set, falling back to default profiles: default
2019-01-09 08:34:00.880  INFO 11492 --- [           main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@b6a97d45: startup date [Wed Jan 09 08:34:00 CET 2019]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@bbb0fe3
2019-01-09 08:34:03.458  INFO 11492 --- [           main] o.s.b.f.config.PropertiesFactoryBean     : Loading properties file from URL [jar:file:/C:/devsbb/eaio-ng/m2/org/springframework/cloud/stream/app/log-sink-rabbit/1.1.0.RELEASE/log-sink-rabbit-1.1.0.RELEASE.jar!/BOOT-INF/lib/spring-integration-core-4.3.4.RELEASE.jar!/META-INF/spring.integration.default.properties]
...
2019-01-09 08:34:05.175  INFO 11492 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.amqp.rabbit.annotation.RabbitBootstrapConfiguration' of type [class org.springframework.amqp.rabbit.annotation.RabbitBootstrapConfiguration$$EnhancerBySpringCGLIB$$fa2f06c4] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-01-09 08:34:05.274  INFO 11492 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.stream.config.ChannelBindingServiceConfiguration$PostProcessorConfiguration' of type [class org.springframework.cloud.stream.config.ChannelBindingServiceConfiguration$PostProcessorConfiguration$$EnhancerBySpringCGLIB$$2b8de122] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-01-09 08:34:05.625  INFO 11492 --- [           main] o.s.b.f.config.PropertiesFactoryBean     : Loading properties file from URL [jar:file:/C:/devsbb/eaio-ng/m2/org/springframework/cloud/stream/app/log-sink-rabbit/1.1.0.RELEASE/log-sink-rabbit-1.1.0.RELEASE.jar!/BOOT-INF/lib/spring-integration-core-4.3.4.RELEASE.jar!/META-INF/spring.integration.default.properties]
...
2019-01-09 08:34:12.541  INFO 11492 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Bean with name 'rabbitConnectionFactory' has been autodetected for JMX exposure
...
2019-01-09 08:34:12.641  INFO 11492 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Located managed bean 'rabbitConnectionFactory': registering with JMX server as MBean [httptest.log:name=rabbitConnectionFactory,type=CachingConnectionFactory]
...
2019-01-09 08:34:16.325  INFO 11492 --- [           main] o.s.c.s.a.l.s.r.LogSinkRabbitApplication : No active profile set, falling back to default profiles: default
2019-01-09 08:34:16.341  INFO 11492 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@d58db63: startup date [Wed Jan 09 08:34:16 CET 2019]; parent: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@b6a97d45
2019-01-09 08:34:16.524  INFO 11492 --- [           main] o.s.c.support.GenericApplicationContext  : Refreshing org.springframework.context.support.GenericApplicationContext@64236aaf: startup date [Wed Jan 09 08:34:16 CET 2019]; root of context hierarchy
2019-01-09 08:34:16.574  INFO 11492 --- [           main] o.s.c.s.a.l.s.r.LogSinkRabbitApplication : Started LogSinkRabbitApplication in 3.399 seconds (JVM running for 24.783)
2019-01-09 08:34:16.591  INFO 11492 --- [           main] o.s.c.s.b.r.RabbitMessageChannelBinder   : declaring queue for inbound: httptest.http.httptest, bound to: httptest.http
2019-01-09 08:34:17.625  WARN 11492 --- [           main] o.s.amqp.rabbit.core.RabbitAdmin         : Failed to declare exchange: Exchange [name=httptest.http, type=topic, durable=true, autoDelete=false, internal=false, arguments={}], continuing...

org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused: connect
    at org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:62) ~[spring-rabbit-1.6.2.RELEASE.jar!/:na]
    at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:309) ~[spring-rabbit-1.6.2.RELEASE.jar!/:na]
    at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:547) ~[spring-rabbit-1.6.2.RELEASE.jar!/:na]
...
2019-01-09 08:34:18.658  WARN 11492 --- [           main] o.s.amqp.rabbit.core.RabbitAdmin         : Failed to declare queue: Queue [name=httptest.http.httptest, durable=true, autoDelete=false, exclusive=false, arguments={}], continuing...

org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused: connect
    at org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:62) ~[spring-rabbit-1.6.2.RELEASE.jar!/:na]
    at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:309) ~[spring-rabbit-1.6.2.RELEASE.jar!/:na]
    at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:547) ~[spring-rabbit-1.6.2.RELEASE.jar!/:na]
...
2019-01-09 08:34:19.741  WARN 11492 --- [           main] o.s.amqp.rabbit.core.RabbitAdmin         : Failed to declare binding: Binding [destination=httptest.http.httptest, exchange=httptest.http, routingKey=#], continuing...

org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused: connect
    at org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:62) ~[spring-rabbit-1.6.2.RELEASE.jar!/:na]
    at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:309) ~[spring-rabbit-1.6.2.RELEASE.jar!/:na]
    at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:547) ~[spring-rabbit-1.6.2.RELEASE.jar!/:na]

2019-01-09 08:34:20.907  INFO 11492 --- [           main] o.s.i.a.i.AmqpInboundChannelAdapter      : started inbound.httptest.http.httptest
2019-01-09 08:34:20.907  INFO 11492 --- [           main] o.s.i.endpoint.EventDrivenConsumer       : Adding {message-handler:inbound.httptest.http.httptest} as a subscriber to the 'bridge.httptest.http' channel
2019-01-09 08:34:20.907  INFO 11492 --- [           main] o.s.i.endpoint.EventDrivenConsumer       : started inbound.httptest.http.httptest
2019-01-09 08:34:20.908  INFO 11492 --- [           main] o.s.c.support.DefaultLifecycleProcessor  : Starting beans in phase 2147483647
2019-01-09 08:34:21.051  INFO 11492 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 40115 (http)
2019-01-09 08:34:21.053  INFO 11492 --- [           main] o.s.c.s.a.l.s.r.LogSinkRabbitApplication : Started LogSinkRabbitApplication in 27.745 seconds (JVM running for 29.262)
2019-01-09 08:34:25.940  WARN 11492 --- [http.httptest-1] o.s.a.r.l.SimpleMessageListenerContainer : Consumer raised exception, processing can restart if the connection factory supports it. Exception summary: org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused: connect
2019-01-09 08:34:25.941  INFO 11492 --- [http.httptest-1] o.s.a.r.l.SimpleMessageListenerContainer : Restarting Consumer: tags=[{}], channel=null, acknowledgeMode=AUTO local queue size=0
2019-01-09 08:34:31.974  WARN 11492 --- [http.httptest-2] o.s.a.r.l.SimpleMessageListenerContainer : Consumer raised exception, processing can restart if the connection factory supports it. Exception summary: org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused: connect
2019-01-09 08:34:31.975  INFO 11492 --- [http.httptest-2] o.s.a.r.l.SimpleMessageListenerContainer : Restarting Consumer: tags=[{}], channel=null, acknowledgeMode=AUTO local queue size=0
2019-01-09 08:34:38.190  WARN 11492 --- [http.httptest-3] o.s.a.r.l.SimpleMessageListenerContainer : Consumer raised exception, processing can restart if the connection factory supports it. Exception summary: org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused: connect
2019-01-09 08:34:38.191  INFO 11492 --- [http.httptest-3] o.s.a.r.l.SimpleMessageListenerContainer : Restarting Consumer: tags=[{}], channel=null, acknowledgeMode=AUTO local queue size=0
...

还有httptest.http的日志:

...
2019-01-09 08:34:01.508  INFO 752 --- [           main] .c.s.a.h.s.r.HttpSourceRabbitApplication : No active profile set, falling back to default profiles: default
...
2019-01-09 08:34:06.075  INFO 752 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.amqp.rabbit.annotation.RabbitBootstrapConfiguration' of type [org.springframework.amqp.rabbit.annotation.RabbitBootstrapConfiguration$$EnhancerBySpringCGLIB$$3cc66233] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
...
2019-01-09 08:34:13.858  INFO 752 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Bean with name 'rabbitConnectionFactory' has been autodetected for JMX exposure
...
2019-01-09 08:34:16.508  INFO 752 --- [           main] .c.s.a.h.s.r.HttpSourceRabbitApplication : No active profile set, falling back to default profiles: default
...
2019-01-09 08:34:16.741  INFO 752 --- [           main] .c.s.a.h.s.r.HttpSourceRabbitApplication : Started HttpSourceRabbitApplication in 2.25 seconds (JVM running for 24.933)
2019-01-09 08:34:18.875  WARN 752 --- [           main] o.s.amqp.rabbit.core.RabbitAdmin         : Failed to declare exchange: Exchange [name=httptest.http, type=topic, durable=true, autoDelete=false, internal=false, arguments={}], continuing... org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused: connect
2019-01-09 08:34:20.924  WARN 752 --- [           main] o.s.amqp.rabbit.core.RabbitAdmin         : Failed to declare queue: Queue [name=httptest.http.httptest, durable=true, autoDelete=false, exclusive=false, arguments={}], continuing... org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused: connect
2019-01-09 08:34:22.974  WARN 752 --- [           main] o.s.amqp.rabbit.core.RabbitAdmin         : Failed to declare binding: Binding [destination=httptest.http.httptest, exchange=httptest.http, routingKey=#], continuing... org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused: connect
...
2019-01-09 08:34:23.158  INFO 752 --- [           main] .c.s.a.h.s.r.HttpSourceRabbitApplication : Started HttpSourceRabbitApplication in 29.7 seconds (JVM running for 31.35)

rabbitMQ的状态如下:

$ ./rabbitmqctl.bat -l status                                                                                                   
Status of node rabbit@K21788.company.ch ...                                                                                         
Error: unable to perform an operation on node 'rabbit@K21788.company.ch'. Please see diagnostics information and suggestions below. 

Most common reasons for this are:                                                                                               

 * Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)                              
 * CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server)        
 * Target node is not running                                                                                                   

In addition to the diagnostics info below:                                                                                      

 * See the CLI, clustering and networking guides on http://rabbitmq.com/documentation.html to learn more                        
 * Consult server logs on node rabbit@K21788.company.ch                                                                             

DIAGNOSTICS                                                                                                                     
===========                                                                                                                     

attempted to contact: ['rabbit@K21788.company.ch']                                                                                  

rabbit@K21788.company.ch:                                                                                                           
  * connected to epmd (port 4369) on K21788.company.ch                                                                              
  * epmd reports: node 'rabbit' not running at all                                                                              
                  other nodes on K21788.company.ch: ['RabbitMQ']                                                                    
  * suggestion: start the node                                                                                                  

Current node details:                                                                                                           
 * node name: 'rabbitmqcli-12044-rabbit@K21788.company.ch'                                                                          
 * effective user's home directory: H:\                                                                                         
 * Erlang cookie hash: 3KrTJSJQpX4BZ0kIYp0cmw==                                                                                 

有什么想法吗?

0 个答案:

没有答案