Tag Archives: RabbitMQ

[Solved] AmqpConnectException: java.net.ConnectException: Connection refused: connect

1、 Problem: spring cloud’s stream integrates rabbitmq

org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused: connect

2、 Detailed error reporting log

The Class-Path manifest attribute in C:\Users\sx\sx_tools\local_maven_repository\com\sun\xml\bind\jaxb-core\2.2.11\jaxb-core-2.2.11.jar referenced one or more files that do not exist: file:/C:/Users/sx/sx_tools/local_maven_repository/com/sun/xml/bind/jaxb-core/2.2.11/jaxb-api.jar
The Class-Path manifest attribute in C:\Users\sx\sx_tools\local_maven_repository\com\sun\xml\bind\jaxb-impl\2.2.11\jaxb-impl-2.2.11.jar referenced one or more files that do not exist: file:/C:/Users/sx/sx_tools/local_maven_repository/com/sun/xml/bind/jaxb-impl/2.2.11/jaxb-core.jar
The Class-Path manifest attribute in C:\Users\sx\sx_tools\local_maven_repository\org\glassfish\jaxb\jaxb-runtime\2.2.10-b140310.1920\jaxb-runtime-2.2.10-b140310.1920.jar referenced one or more files that do not exist: file:/C:/Users/sx/sx_tools/local_maven_repository/org/glassfish/jaxb/jaxb-runtime/2.2.10-b140310.1920/jaxb-core-2.2.10-b140310.1920.jar,file:/C:/Users/sx/sx_tools/local_maven_repository/org/glassfish/jaxb/jaxb-runtime/2.2.10-b140310.1920/jaxb-api-2.2.12-b140109.1041.jar,file:/C:/Users/sx/sx_tools/local_maven_repository/org/glassfish/jaxb/jaxb-runtime/2.2.10-b140310.1920/txw2-2.2.10-b140310.1920.jar,file:/C:/Users/sx/sx_tools/local_maven_repository/org/glassfish/jaxb/jaxb-runtime/2.2.10-b140310.1920/istack-commons-runtime-2.19.jar,file:/C:/Users/sx/sx_tools/local_maven_repository/org/glassfish/jaxb/jaxb-runtime/2.2.10-b140310.1920/stax-ex-1.7.5.jar,file:/C:/Users/sx/sx_tools/local_maven_repository/org/glassfish/jaxb/jaxb-runtime/2.2.10-b140310.1920/FastInfoset-1.2.13.jar
2021-06-22 16:22:39.671  INFO 15896 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2021-06-22 16:22:39.834  INFO 15896 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$b2f39e79] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

  .   ____          _            __ _ _
 /\\/___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, |////
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.1.6.RELEASE)

2021-06-22 16:22:40.223  INFO 15896 --- [  restartedMain] c.d.r.StreamProducerApplication6060      : No active profile set, falling back to default profiles: default
2021-06-22 16:22:40.933  WARN 15896 --- [  restartedMain] o.s.boot.actuate.endpoint.EndpointId     : Endpoint ID 'service-registry' contains invalid characters, please migrate to a valid format.
2021-06-22 16:22:41.113  INFO 15896 --- [  restartedMain] o.s.cloud.context.scope.GenericScope     : BeanFactory id=83cbcc26-92f8-3738-a0e7-687b0dd54a22
2021-06-22 16:22:41.118  INFO 15896 --- [  restartedMain] faultConfiguringBeanFactoryPostProcessor : No bean named 'errorChannel' has been explicitly defined. Therefore, a default PublishSubscribeChannel will be created.
2021-06-22 16:22:41.122  INFO 15896 --- [  restartedMain] faultConfiguringBeanFactoryPostProcessor : No bean named 'taskScheduler' has been explicitly defined. Therefore, a default ThreadPoolTaskScheduler will be created.
2021-06-22 16:22:41.125  INFO 15896 --- [  restartedMain] faultConfiguringBeanFactoryPostProcessor : No bean named 'integrationHeaderChannelRegistry' has been explicitly defined. Therefore, a default DefaultHeaderChannelRegistry will be created.
2021-06-22 16:22:41.195  INFO 15896 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'integrationDisposableAutoCreatedBeans' of type [org.springframework.integration.config.annotation.Disposables] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-22 16:22:41.211  INFO 15896 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.integration.config.IntegrationManagementConfiguration' of type [org.springframework.integration.config.IntegrationManagementConfiguration$$EnhancerBySpringCGLIB$$1cb56ab] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-22 16:22:41.216  INFO 15896 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration$IntegrationJmxConfiguration' of type [org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration$IntegrationJmxConfiguration$$EnhancerBySpringCGLIB$$dd5d61cb] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-22 16:22:41.221  INFO 15896 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration' of type [org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration$$EnhancerBySpringCGLIB$$16450a98] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-22 16:22:41.225  INFO 15896 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'mbeanServer' of type [com.sun.jmx.mbeanserver.JmxMBeanServer] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-22 16:22:41.232  INFO 15896 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$b2f39e79] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-22 16:22:41.693  INFO 15896 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 6060 (http)
2021-06-22 16:22:41.712  INFO 15896 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2021-06-22 16:22:41.713  INFO 15896 --- [  restartedMain] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.21]
2021-06-22 16:22:41.853  INFO 15896 --- [  restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2021-06-22 16:22:41.853  INFO 15896 --- [  restartedMain] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1621 ms
2021-06-22 16:22:41.941  WARN 15896 --- [  restartedMain] c.n.c.sources.URLConfigurationSource     : No URLs will be polled as dynamic configuration sources.
2021-06-22 16:22:41.942  INFO 15896 --- [  restartedMain] c.n.c.sources.URLConfigurationSource     : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2021-06-22 16:22:41.947  INFO 15896 --- [  restartedMain] c.netflix.config.DynamicPropertyFactory  : DynamicPropertyFactory is initialized with configuration sources: com.netflix.config.ConcurrentCompositeConfiguration@5d835b38
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils (file:/C:/Users/sx/sx_tools/local_maven_repository/org/springframework/spring-core/5.1.8.RELEASE/spring-core-5.1.8.RELEASE.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2021-06-22 16:22:42.708  INFO 15896 --- [  restartedMain] o.s.s.c.ThreadPoolTaskScheduler          : Initializing ExecutorService 'taskScheduler'
2021-06-22 16:22:42.939  WARN 15896 --- [  restartedMain] c.n.c.sources.URLConfigurationSource     : No URLs will be polled as dynamic configuration sources.
2021-06-22 16:22:42.939  INFO 15896 --- [  restartedMain] c.n.c.sources.URLConfigurationSource     : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2021-06-22 16:22:43.036  INFO 15896 --- [  restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2021-06-22 16:22:43.345  WARN 15896 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : Unable to start LiveReload server
2021-06-22 16:22:43.764  INFO 15896 --- [  restartedMain] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 2 endpoint(s) beneath base path '/actuator'
2021-06-22 16:22:43.926  INFO 15896 --- [  restartedMain] o.s.i.monitor.IntegrationMBeanExporter   : Registering MessageChannel nullChannel
2021-06-22 16:22:43.937  INFO 15896 --- [  restartedMain] o.s.i.monitor.IntegrationMBeanExporter   : Registering MessageChannel output
2021-06-22 16:22:43.977  INFO 15896 --- [  restartedMain] o.s.i.monitor.IntegrationMBeanExporter   : Registering MessageChannel errorChannel
2021-06-22 16:22:44.001  INFO 15896 --- [  restartedMain] o.s.i.monitor.IntegrationMBeanExporter   : Registering MessageHandler errorLogger
2021-06-22 16:22:44.023  INFO 15896 --- [  restartedMain] o.s.i.endpoint.EventDrivenConsumer       : Adding {logging-channel-adapter:_org.springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel
2021-06-22 16:22:44.024  INFO 15896 --- [  restartedMain] o.s.i.channel.PublishSubscribeChannel    : Channel 'application-1.errorChannel' has 1 subscriber(s).
2021-06-22 16:22:44.024  INFO 15896 --- [  restartedMain] o.s.i.endpoint.EventDrivenConsumer       : started _org.springframework.integration.errorLogger
2021-06-22 16:22:44.359  INFO 15896 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$b2f39e79] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-22 16:22:44.760  INFO 15896 --- [  restartedMain] o.s.a.r.c.CachingConnectionFactory       : Attempting to connect to: [47.103.77.82:5672]
2021-06-22 16:22:45.737  INFO 15896 --- [  restartedMain] o.s.a.r.c.CachingConnectionFactory       : Created new connection: rabbitConnectionFactory#4261c3fa:0/SimpleConnection@6617dc7f [delegate=amqp://[email protected]:5672/, localPort= 9315]
2021-06-22 16:22:45.849  INFO 15896 --- [  restartedMain] o.s.c.s.m.DirectWithAttributesChannel    : Channel 'application-1.output' has 1 subscriber(s).
2021-06-22 16:22:45.870  INFO 15896 --- [  restartedMain] o.s.c.n.eureka.InstanceInfoFactory       : Setting initial instance status as: STARTING
2021-06-22 16:22:45.900  INFO 15896 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Initializing Eureka in region us-east-1
2021-06-22 16:22:46.017  INFO 15896 --- [  restartedMain] c.n.d.provider.DiscoveryJerseyProvider   : Using JSON encoding codec LegacyJacksonJson
2021-06-22 16:22:46.017  INFO 15896 --- [  restartedMain] c.n.d.provider.DiscoveryJerseyProvider   : Using JSON decoding codec LegacyJacksonJson
2021-06-22 16:22:46.094  INFO 15896 --- [  restartedMain] c.n.d.provider.DiscoveryJerseyProvider   : Using XML encoding codec XStreamXml
2021-06-22 16:22:46.094  INFO 15896 --- [  restartedMain] c.n.d.provider.DiscoveryJerseyProvider   : Using XML decoding codec XStreamXml
2021-06-22 16:22:46.198  INFO 15896 --- [  restartedMain] c.n.d.s.r.aws.ConfigClusterResolver      : Resolving eureka endpoints via configuration
2021-06-22 16:22:46.408  INFO 15896 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Disable delta property : false
2021-06-22 16:22:46.408  INFO 15896 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Single vip registry refresh property : null
2021-06-22 16:22:46.408  INFO 15896 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Force full registry fetch : false
2021-06-22 16:22:46.408  INFO 15896 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Application is null : false
2021-06-22 16:22:46.408  INFO 15896 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Registered Applications size is zero : true
2021-06-22 16:22:46.408  INFO 15896 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Application version is -1: true
2021-06-22 16:22:46.408  INFO 15896 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Getting all instance registry info from the eureka server
2021-06-22 16:22:46.530  INFO 15896 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : The response status is 200
2021-06-22 16:22:46.532  INFO 15896 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Starting heartbeat executor: renew interval is: 30
2021-06-22 16:22:46.534  INFO 15896 --- [  restartedMain] c.n.discovery.InstanceInfoReplicator     : InstanceInfoReplicator onDemand update allowed rate per min is 4
2021-06-22 16:22:46.537  INFO 15896 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Discovery Client initialized at timestamp 1624350166536 with initial instances count: 3
2021-06-22 16:22:46.538  INFO 15896 --- [  restartedMain] o.s.c.n.e.s.EurekaServiceRegistry        : Registering application DABING-CLOUD-STREAM-PRODUCER with eureka with status UP
2021-06-22 16:22:46.538  INFO 15896 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Saw local status change event StatusChangeEvent [timestamp=1624350166538, current=UP, previous=STARTING]
2021-06-22 16:22:46.540  INFO 15896 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_DABING-CLOUD-STREAM-PRODUCER/DESKTOP-H0CA6VB:dabing-cloud-stream-producer:6060: registering service...
2021-06-22 16:22:46.563  INFO 15896 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_DABING-CLOUD-STREAM-PRODUCER/DESKTOP-H0CA6VB:dabing-cloud-stream-producer:6060 - registration status: 204
2021-06-22 16:22:46.587  INFO 15896 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 6060 (http) with context path ''
2021-06-22 16:22:46.588  INFO 15896 --- [  restartedMain] .s.c.n.e.s.EurekaAutoServiceRegistration : Updating port to 6060
2021-06-22 16:22:46.590  INFO 15896 --- [  restartedMain] c.d.r.StreamProducerApplication6060      : Started StreamProducerApplication6060 in 7.757 seconds (JVM running for 8.722)
2021-06-22 16:22:47.172  INFO 15896 --- [)-192.168.253.1] o.s.a.r.c.CachingConnectionFactory       : Attempting to connect to: [localhost:5672]
2021-06-22 16:22:47.177  INFO 15896 --- [)-192.168.253.1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2021-06-22 16:22:47.177  INFO 15896 --- [)-192.168.253.1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2021-06-22 16:22:47.187  INFO 15896 --- [)-192.168.253.1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 10 ms
2021-06-22 16:22:49.210  WARN 15896 --- [)-192.168.253.1] o.s.b.a.amqp.RabbitHealthIndicator       : Rabbit health check failed

org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused: connect
	at org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:62) ~[spring-rabbit-2.1.7.RELEASE.jar:2.1.7.RELEASE]
	at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:509) ~[spring-rabbit-2.1.7.RELEASE.jar:2.1.7.RELEASE]
	at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:702) ~[spring-rabbit-2.1.7.RELEASE.jar:2.1.7.RELEASE]
	at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.createConnection(ConnectionFactoryUtils.java:214) ~[spring-rabbit-2.1.7.RELEASE.jar:2.1.7.RELEASE]
	at org.springframework.amqp.rabbit.core.RabbitTemplate.doExecute(RabbitTemplate.java:2073) ~[spring-rabbit-2.1.7.RELEASE.jar:2.1.7.RELEASE]
	at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:2047) ~[spring-rabbit-2.1.7.RELEASE.jar:2.1.7.RELEASE]
	at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:2027) ~[spring-rabbit-2.1.7.RELEASE.jar:2.1.7.RELEASE]
	at org.springframework.boot.actuate.amqp.RabbitHealthIndicator.getVersion(RabbitHealthIndicator.java:49) ~[spring-boot-actuator-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.actuate.amqp.RabbitHealthIndicator.doHealthCheck(RabbitHealthIndicator.java:44) ~[spring-boot-actuator-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.actuate.health.AbstractHealthIndicator.health(AbstractHealthIndicator.java:82) ~[spring-boot-actuator-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.actuate.health.CompositeHealthIndicator.health(CompositeHealthIndicator.java:95) ~[spring-boot-actuator-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.actuate.health.HealthEndpoint.health(HealthEndpoint.java:50) ~[spring-boot-actuator-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
	at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:282) ~[spring-core-5.1.8.RELEASE.jar:5.1.8.RELEASE]
	at org.springframework.boot.actuate.endpoint.invoke.reflect.ReflectiveOperationInvoker.invoke(ReflectiveOperationInvoker.java:76) ~[spring-boot-actuator-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.actuate.endpoint.annotation.AbstractDiscoveredOperation.invoke(AbstractDiscoveredOperation.java:60) ~[spring-boot-actuator-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.actuate.endpoint.jmx.EndpointMBean.invoke(EndpointMBean.java:121) ~[spring-boot-actuator-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.actuate.endpoint.jmx.EndpointMBean.invoke(EndpointMBean.java:96) ~[spring-boot-actuator-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:809) ~[na:na]
	at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) ~[na:na]
	at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1466) ~[na:na]
	at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1307) ~[na:na]
	at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1399) ~[na:na]
	at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:827) ~[na:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
	at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359) ~[na:na]
	at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200) ~[na:na]
	at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197) ~[na:na]
	at java.base/java.security.AccessController.doPrivileged(Native Method) ~[na:na]
	at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196) ~[na:na]
	at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562) ~[na:na]
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796) ~[na:na]
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677) ~[na:na]
	at java.base/java.security.AccessController.doPrivileged(Native Method) ~[na:na]
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
	at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
Caused by: java.net.ConnectException: Connection refused: connect
	at java.base/java.net.PlainSocketImpl.waitForConnect(Native Method) ~[na:na]
	at java.base/java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:107) ~[na:na]
	at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399) ~[na:na]
	at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242) ~[na:na]
	at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224) ~[na:na]
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403) ~[na:na]
	at java.base/java.net.Socket.connect(Socket.java:609) ~[na:na]
	at com.rabbitmq.client.impl.SocketFrameHandlerFactory.create(SocketFrameHandlerFactory.java:60) ~[amqp-client-5.4.3.jar:5.4.3]
	at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1102) ~[amqp-client-5.4.3.jar:5.4.3]
	at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1054) ~[amqp-client-5.4.3.jar:5.4.3]
	at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:994) ~[amqp-client-5.4.3.jar:5.4.3]
	at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:462) ~[spring-rabbit-2.1.7.RELEASE.jar:2.1.7.RELEASE]
	... 42 common frames omitted


3. Analysis

4. Solution

Application.yml complete configuration information

server:
  port: 6060
spring:
  application:
    name: dabing-cloud-stream-producer
  cloud:
    stream:
      binders: # Binding MQ service information (here we are RabbitMQ)
        dabingRabbitBinder: # the name defined for the Binder, used later for the association
          type: rabbit # MQ type, if it's Kafka, configure kafka here
          environment: # MQ environment configuration (username, password, etc.)
            spring:
              rabbitmq:
                host: 47.103.77.82
                port: 5672
                username: root
                password: 123456
      bindings: # Associated integration channels and binder objects
        output: # output is the name of the channel we defined, we can't change it here
          destination: dabingExchange # the name of the exchange to be used (message queue subject name)
          content-type: text/plain # application/json # Message type setting, e.g. json
          binder: dabingRabbitBinder # Associated MQ service
  # Configure the following information, as by default it will try to connect to localhost:5672
  rabbitmq:
    host: 47.103.77.82
    port: 5672
    username: root
    password: 123456

eureka:
  client:
    serviceUrl: # path to eureka server
      defaultZone: http://dabingcloudeurekaservera:8761/eureka/,http://lagoucloudeurekaserverb:8762/eureka/ # All the URLs in the eureka cluster are filled in. You can also write only one, because each eureka server can synchronize its registry
    instance:
      prefer-ip-address: true #Register with ip

5、 Verification: start successfully, complete log information

"C:\Program Files\BellSoft\LibericaJDK-11\bin\java.exe" -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2020.3.1\lib\idea_rt.jar=8650:C:\Program Files\JetBrains\IntelliJ IDEA 2020.3.1\bin" -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -Dfile.encoding=UTF-8 -classpath G:\gitee_local_ws_lg\springcloud_ws2\dabing-resume-parent\dabing-cloud-stream-producer-6060\target\classes;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\cloud\spring-cloud-starter-netflix-eureka-client\2.1.0.RELEASE\spring-cloud-starter-netflix-eureka-client-2.1.0.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\cloud\spring-cloud-starter\2.1.0.RELEASE\spring-cloud-starter-2.1.0.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\cloud\spring-cloud-context\2.1.0.RELEASE\spring-cloud-context-2.1.0.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\security\spring-security-crypto\5.1.5.RELEASE\spring-security-crypto-5.1.5.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\cloud\spring-cloud-commons\2.1.0.RELEASE\spring-cloud-commons-2.1.0.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\security\spring-security-rsa\1.0.7.RELEASE\spring-security-rsa-1.0.7.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\bouncycastle\bcpkix-jdk15on\1.60\bcpkix-jdk15on-1.60.jar;C:\Users\sx\sx_tools\local_maven_repository\org\bouncycastle\bcprov-jdk15on\1.60\bcprov-jdk15on-1.60.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\cloud\spring-cloud-netflix-hystrix\2.1.0.RELEASE\spring-cloud-netflix-hystrix-2.1.0.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\boot\spring-boot-starter-aop\2.1.6.RELEASE\spring-boot-starter-aop-2.1.6.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\aspectj\aspectjweaver\1.9.4\aspectjweaver-1.9.4.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\cloud\spring-cloud-netflix-eureka-client\2.1.0.RELEASE\spring-cloud-netflix-eureka-client-2.1.0.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\com\netflix\eureka\eureka-client\1.9.8\eureka-client-1.9.8.jar;C:\Users\sx\sx_tools\local_maven_repository\org\codehaus\jettison\jettison\1.3.7\jettison-1.3.7.jar;C:\Users\sx\sx_tools\local_maven_repository\stax\stax-api\1.0.1\stax-api-1.0.1.jar;C:\Users\sx\sx_tools\local_maven_repository\com\netflix\netflix-commons\netflix-eventbus\0.3.0\netflix-eventbus-0.3.0.jar;C:\Users\sx\sx_tools\local_maven_repository\com\netflix\netflix-commons\netflix-infix\0.3.0\netflix-infix-0.3.0.jar;C:\Users\sx\sx_tools\local_maven_repository\commons-jxpath\commons-jxpath\1.3\commons-jxpath-1.3.jar;C:\Users\sx\sx_tools\local_maven_repository\joda-time\joda-time\2.10.2\joda-time-2.10.2.jar;C:\Users\sx\sx_tools\local_maven_repository\org\antlr\antlr-runtime\3.4\antlr-runtime-3.4.jar;C:\Users\sx\sx_tools\local_maven_repository\org\antlr\stringtemplate\3.2.1\stringtemplate-3.2.1.jar;C:\Users\sx\sx_tools\local_maven_repository\antlr\antlr\2.7.7\antlr-2.7.7.jar;C:\Users\sx\sx_tools\local_maven_repository\com\google\code\gson\gson\2.8.5\gson-2.8.5.jar;C:\Users\sx\sx_tools\local_maven_repository\org\apache\commons\commons-math\2.2\commons-math-2.2.jar;C:\Users\sx\sx_tools\local_maven_repository\com\netflix\archaius\archaius-core\0.7.6\archaius-core-0.7.6.jar;C:\Users\sx\sx_tools\local_maven_repository\com\google\guava\guava\16.0\guava-16.0.jar;C:\Users\sx\sx_tools\local_maven_repository\javax\ws\rs\jsr311-api\1.1.1\jsr311-api-1.1.1.jar;C:\Users\sx\sx_tools\local_maven_repository\com\netflix\servo\servo-core\0.12.21\servo-core-0.12.21.jar;C:\Users\sx\sx_tools\local_maven_repository\com\sun\jersey\jersey-core\1.19.1\jersey-core-1.19.1.jar;C:\Users\sx\sx_tools\local_maven_repository\com\sun\jersey\jersey-client\1.19.1\jersey-client-1.19.1.jar;C:\Users\sx\sx_tools\local_maven_repository\com\sun\jersey\contribs\jersey-apache-client4\1.19.1\jersey-apache-client4-1.19.1.jar;C:\Users\sx\sx_tools\local_maven_repository\org\apache\httpcomponents\httpclient\4.5.9\httpclient-4.5.9.jar;C:\Users\sx\sx_tools\local_maven_repository\org\apache\httpcomponents\httpcore\4.4.11\httpcore-4.4.11.jar;C:\Users\sx\sx_tools\local_maven_repository\commons-codec\commons-codec\1.11\commons-codec-1.11.jar;C:\Users\sx\sx_tools\local_maven_repository\com\google\inject\guice\4.1.0\guice-4.1.0.jar;C:\Users\sx\sx_tools\local_maven_repository\javax\inject\javax.inject\1\javax.inject-1.jar;C:\Users\sx\sx_tools\local_maven_repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;C:\Users\sx\sx_tools\local_maven_repository\com\github\vlsi\compactmap\compactmap\1.2.1\compactmap-1.2.1.jar;C:\Users\sx\sx_tools\local_maven_repository\com\github\andrewoma\dexx\dexx-collections\0.2\dexx-collections-0.2.jar;C:\Users\sx\sx_tools\local_maven_repository\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;C:\Users\sx\sx_tools\local_maven_repository\com\fasterxml\jackson\core\jackson-core\2.9.9\jackson-core-2.9.9.jar;C:\Users\sx\sx_tools\local_maven_repository\com\fasterxml\jackson\core\jackson-databind\2.9.9\jackson-databind-2.9.9.jar;C:\Users\sx\sx_tools\local_maven_repository\com\netflix\eureka\eureka-core\1.9.8\eureka-core-1.9.8.jar;C:\Users\sx\sx_tools\local_maven_repository\org\codehaus\woodstox\woodstox-core-asl\4.4.1\woodstox-core-asl-4.4.1.jar;C:\Users\sx\sx_tools\local_maven_repository\javax\xml\stream\stax-api\1.0-2\stax-api-1.0-2.jar;C:\Users\sx\sx_tools\local_maven_repository\org\codehaus\woodstox\stax2-api\3.1.4\stax2-api-3.1.4.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\cloud\spring-cloud-starter-netflix-archaius\2.1.0.RELEASE\spring-cloud-starter-netflix-archaius-2.1.0.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\cloud\spring-cloud-netflix-ribbon\2.1.0.RELEASE\spring-cloud-netflix-ribbon-2.1.0.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\cloud\spring-cloud-netflix-archaius\2.1.0.RELEASE\spring-cloud-netflix-archaius-2.1.0.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\commons-configuration\commons-configuration\1.8\commons-configuration-1.8.jar;C:\Users\sx\sx_tools\local_maven_repository\commons-lang\commons-lang\2.6\commons-lang-2.6.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\cloud\spring-cloud-starter-netflix-ribbon\2.1.0.RELEASE\spring-cloud-starter-netflix-ribbon-2.1.0.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\com\netflix\ribbon\ribbon\2.3.0\ribbon-2.3.0.jar;C:\Users\sx\sx_tools\local_maven_repository\com\netflix\ribbon\ribbon-transport\2.3.0\ribbon-transport-2.3.0.jar;C:\Users\sx\sx_tools\local_maven_repository\io\reactivex\rxnetty-contexts\0.4.9\rxnetty-contexts-0.4.9.jar;C:\Users\sx\sx_tools\local_maven_repository\io\reactivex\rxnetty-servo\0.4.9\rxnetty-servo-0.4.9.jar;C:\Users\sx\sx_tools\local_maven_repository\com\netflix\hystrix\hystrix-core\1.5.18\hystrix-core-1.5.18.jar;C:\Users\sx\sx_tools\local_maven_repository\io\reactivex\rxnetty\0.4.9\rxnetty-0.4.9.jar;C:\Users\sx\sx_tools\local_maven_repository\com\netflix\ribbon\ribbon-core\2.3.0\ribbon-core-2.3.0.jar;C:\Users\sx\sx_tools\local_maven_repository\com\netflix\ribbon\ribbon-httpclient\2.3.0\ribbon-httpclient-2.3.0.jar;C:\Users\sx\sx_tools\local_maven_repository\commons-collections\commons-collections\3.2.2\commons-collections-3.2.2.jar;C:\Users\sx\sx_tools\local_maven_repository\com\netflix\netflix-commons\netflix-commons-util\0.3.0\netflix-commons-util-0.3.0.jar;C:\Users\sx\sx_tools\local_maven_repository\com\netflix\ribbon\ribbon-loadbalancer\2.3.0\ribbon-loadbalancer-2.3.0.jar;C:\Users\sx\sx_tools\local_maven_repository\com\netflix\netflix-commons\netflix-statistics\0.1.1\netflix-statistics-0.1.1.jar;C:\Users\sx\sx_tools\local_maven_repository\io\reactivex\rxjava\1.3.8\rxjava-1.3.8.jar;C:\Users\sx\sx_tools\local_maven_repository\com\netflix\ribbon\ribbon-eureka\2.3.0\ribbon-eureka-2.3.0.jar;C:\Users\sx\sx_tools\local_maven_repository\org\slf4j\slf4j-api\1.7.26\slf4j-api-1.7.26.jar;C:\Users\sx\sx_tools\local_maven_repository\com\thoughtworks\xstream\xstream\1.4.10\xstream-1.4.10.jar;C:\Users\sx\sx_tools\local_maven_repository\xmlpull\xmlpull\1.1.3.1\xmlpull-1.1.3.1.jar;C:\Users\sx\sx_tools\local_maven_repository\xpp3\xpp3_min\1.1.4c\xpp3_min-1.1.4c.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\cloud\spring-cloud-starter-stream-rabbit\2.1.0.RELEASE\spring-cloud-starter-stream-rabbit-2.1.0.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\cloud\spring-cloud-stream-binder-rabbit\2.1.0.RELEASE\spring-cloud-stream-binder-rabbit-2.1.0.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\cloud\spring-cloud-stream-binder-rabbit-core\2.1.0.RELEASE\spring-cloud-stream-binder-rabbit-core-2.1.0.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\com\rabbitmq\http-client\2.1.0.RELEASE\http-client-2.1.0.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\cloud\spring-cloud-stream\2.1.0.RELEASE\spring-cloud-stream-2.1.0.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\boot\spring-boot-starter-validation\2.1.6.RELEASE\spring-boot-starter-validation-2.1.6.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\spring-messaging\5.1.8.RELEASE\spring-messaging-5.1.8.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\spring-tuple\1.0.0.RELEASE\spring-tuple-1.0.0.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\com\esotericsoftware\kryo-shaded\3.0.3\kryo-shaded-3.0.3.jar;C:\Users\sx\sx_tools\local_maven_repository\com\esotericsoftware\minlog\1.3.0\minlog-1.3.0.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\integration\spring-integration-tuple\1.0.0.RELEASE\spring-integration-tuple-1.0.0.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\retry\spring-retry\1.2.4.RELEASE\spring-retry-1.2.4.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\cloud\spring-cloud-function-context\2.0.0.RELEASE\spring-cloud-function-context-2.0.0.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\cloud\spring-cloud-function-core\2.0.0.RELEASE\spring-cloud-function-core-2.0.0.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\boot\spring-boot-starter-amqp\2.1.6.RELEASE\spring-boot-starter-amqp-2.1.6.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\amqp\spring-rabbit\2.1.7.RELEASE\spring-rabbit-2.1.7.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\amqp\spring-amqp\2.1.7.RELEASE\spring-amqp-2.1.7.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\com\rabbitmq\amqp-client\5.4.3\amqp-client-5.4.3.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\integration\spring-integration-amqp\5.1.6.RELEASE\spring-integration-amqp-5.1.6.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\integration\spring-integration-core\5.1.6.RELEASE\spring-integration-core-5.1.6.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\spring-tx\5.1.8.RELEASE\spring-tx-5.1.8.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\io\projectreactor\reactor-core\3.2.10.RELEASE\reactor-core-3.2.10.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\reactivestreams\reactive-streams\1.0.2\reactive-streams-1.0.2.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\integration\spring-integration-jmx\5.1.6.RELEASE\spring-integration-jmx-5.1.6.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\boot\spring-boot-starter-web\2.1.6.RELEASE\spring-boot-starter-web-2.1.6.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\boot\spring-boot-starter\2.1.6.RELEASE\spring-boot-starter-2.1.6.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\javax\annotation\javax.annotation-api\1.3.2\javax.annotation-api-1.3.2.jar;C:\Users\sx\sx_tools\local_maven_repository\org\yaml\snakeyaml\1.23\snakeyaml-1.23.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\boot\spring-boot-starter-json\2.1.6.RELEASE\spring-boot-starter-json-2.1.6.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.9.9\jackson-datatype-jdk8-2.9.9.jar;C:\Users\sx\sx_tools\local_maven_repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.9.9\jackson-datatype-jsr310-2.9.9.jar;C:\Users\sx\sx_tools\local_maven_repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.9.9\jackson-module-parameter-names-2.9.9.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\boot\spring-boot-starter-tomcat\2.1.6.RELEASE\spring-boot-starter-tomcat-2.1.6.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\apache\tomcat\embed\tomcat-embed-core\9.0.21\tomcat-embed-core-9.0.21.jar;C:\Users\sx\sx_tools\local_maven_repository\org\apache\tomcat\embed\tomcat-embed-el\9.0.21\tomcat-embed-el-9.0.21.jar;C:\Users\sx\sx_tools\local_maven_repository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.21\tomcat-embed-websocket-9.0.21.jar;C:\Users\sx\sx_tools\local_maven_repository\org\hibernate\validator\hibernate-validator\6.0.17.Final\hibernate-validator-6.0.17.Final.jar;C:\Users\sx\sx_tools\local_maven_repository\javax\validation\validation-api\2.0.1.Final\validation-api-2.0.1.Final.jar;C:\Users\sx\sx_tools\local_maven_repository\org\jboss\logging\jboss-logging\3.3.2.Final\jboss-logging-3.3.2.Final.jar;C:\Users\sx\sx_tools\local_maven_repository\com\fasterxml\classmate\1.4.0\classmate-1.4.0.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\spring-web\5.1.8.RELEASE\spring-web-5.1.8.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\spring-beans\5.1.8.RELEASE\spring-beans-5.1.8.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\spring-webmvc\5.1.8.RELEASE\spring-webmvc-5.1.8.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\spring-aop\5.1.8.RELEASE\spring-aop-5.1.8.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\spring-context\5.1.8.RELEASE\spring-context-5.1.8.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\spring-expression\5.1.8.RELEASE\spring-expression-5.1.8.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\boot\spring-boot-starter-logging\2.1.6.RELEASE\spring-boot-starter-logging-2.1.6.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;C:\Users\sx\sx_tools\local_maven_repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;C:\Users\sx\sx_tools\local_maven_repository\org\apache\logging\log4j\log4j-to-slf4j\2.11.2\log4j-to-slf4j-2.11.2.jar;C:\Users\sx\sx_tools\local_maven_repository\org\apache\logging\log4j\log4j-api\2.11.2\log4j-api-2.11.2.jar;C:\Users\sx\sx_tools\local_maven_repository\org\slf4j\jul-to-slf4j\1.7.26\jul-to-slf4j-1.7.26.jar;C:\Users\sx\sx_tools\local_maven_repository\org\objenesis\objenesis\2.6\objenesis-2.6.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\spring-core\5.1.8.RELEASE\spring-core-5.1.8.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\spring-jcl\5.1.8.RELEASE\spring-jcl-5.1.8.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\projectlombok\lombok\1.18.4\lombok-1.18.4.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\boot\spring-boot-starter-actuator\2.1.6.RELEASE\spring-boot-starter-actuator-2.1.6.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\boot\spring-boot-actuator-autoconfigure\2.1.6.RELEASE\spring-boot-actuator-autoconfigure-2.1.6.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\boot\spring-boot-actuator\2.1.6.RELEASE\spring-boot-actuator-2.1.6.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\io\micrometer\micrometer-core\1.1.5\micrometer-core-1.1.5.jar;C:\Users\sx\sx_tools\local_maven_repository\org\hdrhistogram\HdrHistogram\2.1.9\HdrHistogram-2.1.9.jar;C:\Users\sx\sx_tools\local_maven_repository\org\latencyutils\LatencyUtils\2.0.3\LatencyUtils-2.0.3.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\boot\spring-boot-devtools\2.1.6.RELEASE\spring-boot-devtools-2.1.6.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\boot\spring-boot\2.1.6.RELEASE\spring-boot-2.1.6.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\org\springframework\boot\spring-boot-autoconfigure\2.1.6.RELEASE\spring-boot-autoconfigure-2.1.6.RELEASE.jar;C:\Users\sx\sx_tools\local_maven_repository\com\sun\xml\bind\jaxb-core\2.2.11\jaxb-core-2.2.11.jar;C:\Users\sx\sx_tools\local_maven_repository\javax\xml\bind\jaxb-api\2.3.1\jaxb-api-2.3.1.jar;C:\Users\sx\sx_tools\local_maven_repository\javax\activation\javax.activation-api\1.2.0\javax.activation-api-1.2.0.jar;C:\Users\sx\sx_tools\local_maven_repository\com\sun\xml\bind\jaxb-impl\2.2.11\jaxb-impl-2.2.11.jar;C:\Users\sx\sx_tools\local_maven_repository\org\glassfish\jaxb\jaxb-runtime\2.2.10-b140310.1920\jaxb-runtime-2.2.10-b140310.1920.jar;C:\Users\sx\sx_tools\local_maven_repository\javax\activation\activation\1.1.1\activation-1.1.1.jar com.dabing.resume.StreamProducerApplication6060
The Class-Path manifest attribute in C:\Users\sx\sx_tools\local_maven_repository\com\sun\xml\bind\jaxb-core\2.2.11\jaxb-core-2.2.11.jar referenced one or more files that do not exist: file:/C:/Users/sx/sx_tools/local_maven_repository/com/sun/xml/bind/jaxb-core/2.2.11/jaxb-api.jar
The Class-Path manifest attribute in C:\Users\sx\sx_tools\local_maven_repository\com\sun\xml\bind\jaxb-impl\2.2.11\jaxb-impl-2.2.11.jar referenced one or more files that do not exist: file:/C:/Users/sx/sx_tools/local_maven_repository/com/sun/xml/bind/jaxb-impl/2.2.11/jaxb-core.jar
The Class-Path manifest attribute in C:\Users\sx\sx_tools\local_maven_repository\org\glassfish\jaxb\jaxb-runtime\2.2.10-b140310.1920\jaxb-runtime-2.2.10-b140310.1920.jar referenced one or more files that do not exist: file:/C:/Users/sx/sx_tools/local_maven_repository/org/glassfish/jaxb/jaxb-runtime/2.2.10-b140310.1920/jaxb-core-2.2.10-b140310.1920.jar,file:/C:/Users/sx/sx_tools/local_maven_repository/org/glassfish/jaxb/jaxb-runtime/2.2.10-b140310.1920/jaxb-api-2.2.12-b140109.1041.jar,file:/C:/Users/sx/sx_tools/local_maven_repository/org/glassfish/jaxb/jaxb-runtime/2.2.10-b140310.1920/txw2-2.2.10-b140310.1920.jar,file:/C:/Users/sx/sx_tools/local_maven_repository/org/glassfish/jaxb/jaxb-runtime/2.2.10-b140310.1920/istack-commons-runtime-2.19.jar,file:/C:/Users/sx/sx_tools/local_maven_repository/org/glassfish/jaxb/jaxb-runtime/2.2.10-b140310.1920/stax-ex-1.7.5.jar,file:/C:/Users/sx/sx_tools/local_maven_repository/org/glassfish/jaxb/jaxb-runtime/2.2.10-b140310.1920/FastInfoset-1.2.13.jar
2021-06-22 16:31:31.662  INFO 9508 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2021-06-22 16:31:31.830  INFO 9508 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$c00266f3] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

  .   ____          _            __ _ _
 /\\/___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, |////
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.1.6.RELEASE)

2021-06-22 16:31:32.237  INFO 9508 --- [  restartedMain] c.d.r.StreamProducerApplication6060      : No active profile set, falling back to default profiles: default
2021-06-22 16:31:33.030  WARN 9508 --- [  restartedMain] o.s.boot.actuate.endpoint.EndpointId     : Endpoint ID 'service-registry' contains invalid characters, please migrate to a valid format.
2021-06-22 16:31:33.213  INFO 9508 --- [  restartedMain] o.s.cloud.context.scope.GenericScope     : BeanFactory id=83cbcc26-92f8-3738-a0e7-687b0dd54a22
2021-06-22 16:31:33.219  INFO 9508 --- [  restartedMain] faultConfiguringBeanFactoryPostProcessor : No bean named 'errorChannel' has been explicitly defined. Therefore, a default PublishSubscribeChannel will be created.
2021-06-22 16:31:33.223  INFO 9508 --- [  restartedMain] faultConfiguringBeanFactoryPostProcessor : No bean named 'taskScheduler' has been explicitly defined. Therefore, a default ThreadPoolTaskScheduler will be created.
2021-06-22 16:31:33.227  INFO 9508 --- [  restartedMain] faultConfiguringBeanFactoryPostProcessor : No bean named 'integrationHeaderChannelRegistry' has been explicitly defined. Therefore, a default DefaultHeaderChannelRegistry will be created.
2021-06-22 16:31:33.299  INFO 9508 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'integrationDisposableAutoCreatedBeans' of type [org.springframework.integration.config.annotation.Disposables] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-22 16:31:33.319  INFO 9508 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.integration.config.IntegrationManagementConfiguration' of type [org.springframework.integration.config.IntegrationManagementConfiguration$$EnhancerBySpringCGLIB$$eda1f25] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-22 16:31:33.324  INFO 9508 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration$IntegrationJmxConfiguration' of type [org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration$IntegrationJmxConfiguration$$EnhancerBySpringCGLIB$$ea6c2a45] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-22 16:31:33.331  INFO 9508 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration' of type [org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration$$EnhancerBySpringCGLIB$$2353d312] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-22 16:31:33.335  INFO 9508 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'mbeanServer' of type [com.sun.jmx.mbeanserver.JmxMBeanServer] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-22 16:31:33.347  INFO 9508 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$c00266f3] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-22 16:31:33.833  INFO 9508 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 6060 (http)
2021-06-22 16:31:33.854  INFO 9508 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2021-06-22 16:31:33.855  INFO 9508 --- [  restartedMain] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.21]
2021-06-22 16:31:33.979  INFO 9508 --- [  restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2021-06-22 16:31:33.979  INFO 9508 --- [  restartedMain] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1733 ms
2021-06-22 16:31:34.067  WARN 9508 --- [  restartedMain] c.n.c.sources.URLConfigurationSource     : No URLs will be polled as dynamic configuration sources.
2021-06-22 16:31:34.067  INFO 9508 --- [  restartedMain] c.n.c.sources.URLConfigurationSource     : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2021-06-22 16:31:34.075  INFO 9508 --- [  restartedMain] c.netflix.config.DynamicPropertyFactory  : DynamicPropertyFactory is initialized with configuration sources: com.netflix.config.ConcurrentCompositeConfiguration@18bc98b6
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils (file:/C:/Users/sx/sx_tools/local_maven_repository/org/springframework/spring-core/5.1.8.RELEASE/spring-core-5.1.8.RELEASE.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2021-06-22 16:31:34.921  INFO 9508 --- [  restartedMain] o.s.s.c.ThreadPoolTaskScheduler          : Initializing ExecutorService 'taskScheduler'
2021-06-22 16:31:35.172  WARN 9508 --- [  restartedMain] c.n.c.sources.URLConfigurationSource     : No URLs will be polled as dynamic configuration sources.
2021-06-22 16:31:35.172  INFO 9508 --- [  restartedMain] c.n.c.sources.URLConfigurationSource     : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2021-06-22 16:31:35.267  INFO 9508 --- [  restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2021-06-22 16:31:35.619  WARN 9508 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : Unable to start LiveReload server
2021-06-22 16:31:36.016  INFO 9508 --- [  restartedMain] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 2 endpoint(s) beneath base path '/actuator'
2021-06-22 16:31:36.169  INFO 9508 --- [  restartedMain] o.s.i.monitor.IntegrationMBeanExporter   : Registering MessageChannel errorChannel
2021-06-22 16:31:36.215  INFO 9508 --- [  restartedMain] o.s.i.monitor.IntegrationMBeanExporter   : Registering MessageChannel output
2021-06-22 16:31:36.238  INFO 9508 --- [  restartedMain] o.s.i.monitor.IntegrationMBeanExporter   : Registering MessageChannel nullChannel
2021-06-22 16:31:36.250  INFO 9508 --- [  restartedMain] o.s.i.monitor.IntegrationMBeanExporter   : Registering MessageHandler errorLogger
2021-06-22 16:31:36.273  INFO 9508 --- [  restartedMain] o.s.i.endpoint.EventDrivenConsumer       : Adding {logging-channel-adapter:_org.springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel
2021-06-22 16:31:36.273  INFO 9508 --- [  restartedMain] o.s.i.channel.PublishSubscribeChannel    : Channel 'application-1.errorChannel' has 1 subscriber(s).
2021-06-22 16:31:36.273  INFO 9508 --- [  restartedMain] o.s.i.endpoint.EventDrivenConsumer       : started _org.springframework.integration.errorLogger
2021-06-22 16:31:36.618  INFO 9508 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$c00266f3] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-22 16:31:37.054  INFO 9508 --- [  restartedMain] o.s.a.r.c.CachingConnectionFactory       : Attempting to connect to: [47.103.77.82:5672]
2021-06-22 16:31:37.789  INFO 9508 --- [  restartedMain] o.s.a.r.c.CachingConnectionFactory       : Created new connection: rabbitConnectionFactory#34a729b:0/SimpleConnection@60c79429 [delegate=amqp://[email protected]:5672/, localPort= 10853]
2021-06-22 16:31:38.662  INFO 9508 --- [  restartedMain] o.s.c.s.m.DirectWithAttributesChannel    : Channel 'application-1.output' has 1 subscriber(s).
2021-06-22 16:31:38.689  INFO 9508 --- [  restartedMain] o.s.c.n.eureka.InstanceInfoFactory       : Setting initial instance status as: STARTING
2021-06-22 16:31:38.719  INFO 9508 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Initializing Eureka in region us-east-1
2021-06-22 16:31:38.824  INFO 9508 --- [  restartedMain] c.n.d.provider.DiscoveryJerseyProvider   : Using JSON encoding codec LegacyJacksonJson
2021-06-22 16:31:38.824  INFO 9508 --- [  restartedMain] c.n.d.provider.DiscoveryJerseyProvider   : Using JSON decoding codec LegacyJacksonJson
2021-06-22 16:31:38.908  INFO 9508 --- [  restartedMain] c.n.d.provider.DiscoveryJerseyProvider   : Using XML encoding codec XStreamXml
2021-06-22 16:31:38.908  INFO 9508 --- [  restartedMain] c.n.d.provider.DiscoveryJerseyProvider   : Using XML decoding codec XStreamXml
2021-06-22 16:31:39.022  INFO 9508 --- [  restartedMain] c.n.d.s.r.aws.ConfigClusterResolver      : Resolving eureka endpoints via configuration
2021-06-22 16:31:39.225  INFO 9508 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Disable delta property : false
2021-06-22 16:31:39.225  INFO 9508 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Single vip registry refresh property : null
2021-06-22 16:31:39.225  INFO 9508 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Force full registry fetch : false
2021-06-22 16:31:39.225  INFO 9508 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Application is null : false
2021-06-22 16:31:39.225  INFO 9508 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Registered Applications size is zero : true
2021-06-22 16:31:39.225  INFO 9508 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Application version is -1: true
2021-06-22 16:31:39.225  INFO 9508 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Getting all instance registry info from the eureka server
2021-06-22 16:31:39.387  INFO 9508 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : The response status is 200
2021-06-22 16:31:39.390  INFO 9508 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Starting heartbeat executor: renew interval is: 30
2021-06-22 16:31:39.392  INFO 9508 --- [  restartedMain] c.n.discovery.InstanceInfoReplicator     : InstanceInfoReplicator onDemand update allowed rate per min is 4
2021-06-22 16:31:39.395  INFO 9508 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Discovery Client initialized at timestamp 1624350699394 with initial instances count: 3
2021-06-22 16:31:39.396  INFO 9508 --- [  restartedMain] o.s.c.n.e.s.EurekaServiceRegistry        : Registering application DABING-CLOUD-STREAM-PRODUCER with eureka with status UP
2021-06-22 16:31:39.396  INFO 9508 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Saw local status change event StatusChangeEvent [timestamp=1624350699396, current=UP, previous=STARTING]
2021-06-22 16:31:39.397  INFO 9508 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_DABING-CLOUD-STREAM-PRODUCER/DESKTOP-H0CA6VB:dabing-cloud-stream-producer:6060: registering service...
2021-06-22 16:31:39.422  INFO 9508 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_DABING-CLOUD-STREAM-PRODUCER/DESKTOP-H0CA6VB:dabing-cloud-stream-producer:6060 - registration status: 204
2021-06-22 16:31:39.446  INFO 9508 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 6060 (http) with context path ''
2021-06-22 16:31:39.446  INFO 9508 --- [  restartedMain] .s.c.n.e.s.EurekaAutoServiceRegistration : Updating port to 6060
2021-06-22 16:31:39.448  INFO 9508 --- [  restartedMain] c.d.r.StreamProducerApplication6060      : Started StreamProducerApplication6060 in 8.731 seconds (JVM running for 9.955)
2021-06-22 16:31:39.672  INFO 9508 --- [)-192.168.253.1] o.s.a.r.c.CachingConnectionFactory       : Attempting to connect to: [47.103.77.82:5672]
2021-06-22 16:31:39.810  INFO 9508 --- [)-192.168.253.1] o.s.a.r.c.CachingConnectionFactory       : Created new connection: rabbitConnectionFactory#2950f454:0/SimpleConnection@71669d37 [delegate=amqp://[email protected]:5672/, localPort= 10861]
2021-06-22 16:31:40.051  INFO 9508 --- [)-192.168.253.1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2021-06-22 16:31:40.051  INFO 9508 --- [)-192.168.253.1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2021-06-22 16:31:40.060  INFO 9508 --- [)-192.168.253.1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 9 ms

The problem of inconsistent host names in building rabbitmq on Linux

1. Environment:

centos 7.3

2. Problem description

Today, the following error occurred in the process of deploying rabbitmq as a front-end and back-end message push

$ rabbitmqctl set_permissions -p/duni ".*" ".*" ".*"

Error: unable to connect to node rabbit@bbbbdddd: nodedown

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

attempted to contact: [rabbit@bbbbdddd]

rabbit@bbbbdddd:
  * connected to epmd (port 4369) on bbbbdddd
  * epmd reports node 'rabbit' running on port 25672
  * TCP connection succeeded but Erlang distribution failed

  * Hostname mismatch: node "rabbit@localhost" believes its host is different. Please ensure that hostnames resolve the same way locally and on "rabbit@localhost"


current node details:
- node name: 'rabbitmq-cli-92@bbbbdddd'
- home dir: /var/lib/rabbitmq
- cookie hash: h6TDjQ+DgPaVGJLMjcG4TA==

I can’t connect to the host where I deployed rabbitmq bbbbdddd

3. Google

Google found the corresponding problem in stack overflow

Here we say to give rabbitmq command permission, delete the service and then re install it. After trying, I found that I can’t do it…

Continue with Google, and some people say to correct Erlang’s Cookie:

Erlang will generate two cookie files: C: windows. Erlang. Cookie and C: user. Erlang. Cookie. Check whether the contents of the two files are consistent. If not, replace one with the other.

Windows platform, er… My environment is Linux, and I didn’t find two . Erlang. Cookie files in the root directory

$ find/--name .erlang.cookie
/var/lib/rabbitmq/.erlang.cookie

So I gave up.

4. Solutions

The final solution is to set the host name and restart the rabbitmq service

# Kill the rabbitmq process first
$ ps -ef | grep rabbitmq | grep -v grep | awk '{print $2}' | xargs kill -9

# set hostname (assume host ip is: 192.168.1.1, hostname set to: mq)
$ echo 192.168.1.1 mq > /etc/hosts
$ echo rabbitmq > /etc/hostname
$ export HOSTNAME=mq

# Restart rabbitmq
$ rabbitmq-server -detached
# Start the web socket service
$ rabbitmq-plugins enable rabbitmq_management rabbitmq_web_stomp
# Set up users and give them administrator privileges
$ rabbitmqctl add_user duni duni
$ rabbitmqctl set_user_tags duni administrator
# set user directory
$ rabbitmqctl set_permissions -p/duni ".*" ".*" ".*"

Ubuntu: rabbitmq reports an error; Solution error: unable to connect to node rabbit@localhost : nodedown

When installing rabbitmq and executing rabbitmqctl status, the errors are as follows:

the first thing is to check the log file and form a good habit here’s my list:

root@jin:/# cd /var/log/rabbitmq/
root@jin:/var/log/rabbitmq# ls
[email protected]  [email protected]  startup_err  startup_log
# Afterwards, execute the view
cat [email protected]

As shown in the figure:

my reason is that port 5672 is occupied by other applications, so rabbitmq can’t be used. Just modify the port

RabbitMQ The channelMax limit is reached. Try later. [How to Solve]

Anomaly interpretation

In a high concurrency scenario, the number of channels reaches the limit, so they cannot continue to be created

Self-built rabbitmq solution

1. Custom configuration

@Configuration
@Slf4j
public class RabbitMQConfig {


    @Bean
    public RabbitTemplate rabbitTemplate(final ConnectionFactory connectionFactory) {
        CachingConnectionFactory cachingConnectionFactory = (CachingConnectionFactory) connectionFactory;
        // set ChannelMax as 4095
        cachingConnectionFactory.getRabbitConnectionFactory().setRequestedChannelMax(4095);
        final RabbitTemplate rabbitTemplate = new RabbitTemplate(cachingConnectionFactory);
        rabbitTemplate.setMessageConverter(jackson2MessageConverter());
        rabbitTemplate.setMandatory(true);
        rabbitTemplate.setConfirmCallback((correlationData, b, s) -> {
            if(!b){
                log.error("confirmCallBack Sending failed data: {}",correlationData);
                log.error("confirmCallBack Confirmation status: {}",b);
                log.error("ConfirmCallBack Reason for sending failure: {}",s);
            }
        });
        rabbitTemplate.setReturnCallback((message, i, s, s1, s2) -> {
            log.error("returnCallBack message: {}",message);
            log.error("returnCallBack response code: {}",i);
            log.error("returnCallBack response message: {}",s);
            log.error("returnCallBack Switch: {}",s1);
            log.error("returnCallBack Routing Key.{}",s2);
        });
        return rabbitTemplate;
    }

    @Bean
    public Jackson2JsonMessageConverter jackson2MessageConverter() {
        return new Jackson2JsonMessageConverter();
    }
}

2. Modify the configuration of MQ server synchronously
rabbitmq.conf

## Set the max permissible number of channels per connection.
## 0 means "no limit".
##In the configuration file, just enter the following parameters and the value you want to set, if you don't use 2047, then you don't need to configure
# channel_max = 128

Rabbitmq solution for cloud services

For paid versions of MQ cloud services, you can try the following to configure rabbitMq connection caching

springBoot 2.3+

  rabbitmq:
    cache:
      connection:
        size: 1000
      channel:
        size: 64

Error report on startup of rabbitmq in MAC installation error:epmd error for host xiongmindeMacBook-Pro: timeout

Error in starting rabbitmq: error:epmd error for host xiongmindeMacBook-Pro: timeout

Error in starting management console plug-in:

Applying plugin configuration to rabbit@xiongmindeMacBook-Pro… failed.
* Could not contact node rabbit@xiongmindeMacBook-Pro.
Changes will take effect at broker restart.
* Options: –online – fail if broker cannot be contacted.
–offline – do not try to contact broker

terms of settlement:

On the last line of sudo VIM/etc/hosts, add “127.0.0.1” xiaominde MacBook Pro

Docker starts the image and reports an error. Iptables failed: iptables — wait – t NAT – a docker – P TCP

Iptables failed: iptables –wait -t nat-a docker-p TCP –wait -t nat-a docker-p TCP
Yesterday afternoon Docker started RabbitMQ and reported an error. I checked a lot of information and could not get it right. Finally, Docker was restarted and solved.
in addition to pull the rabbitmq is take the web management interface with management, command to write

docker pull rabbitmq:management

At the beginning of the pull is wrong for a long time

[root@localhost etc]# docker images
REPOSITORY                                                TAG                 IMAGE ID            CREATED             SIZE
docker.io/rabbitmq                                        management          4af5c5534d00        6 days ago          180 MB
docker.io/rabbitmq                                        latest              86a895bb41d6        6 days ago          150 MB
docker.io/redis                                           latest              01a52b3b5cd1        13 days ago         98.2 MB

Only the first one is
with a Web administration interface

Resolve rabbitmq declarationexception: failed to declare queue exception

exception description

error when creating queue for message sending

org.springframework.amqp.rabbit.listener.BlockingQueueConsumer$DeclarationException: Failed to declare queue(s):[miaosha.queue]
    at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.attemptPassiveDeclarations(BlockingQueueConsumer.java:721) ~[spring-rabbit-1.7.9.RELEASE.jar:na]
    at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.start(BlockingQueueConsumer.java:598) ~[spring-rabbit-1.7.9.RELEASE.jar:na]
    at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1504) [spring-rabbit-1.7.9.RELEASE.jar:na]
    at java.lang.Thread.run(Thread.java:748) [na:1.8.0_131]
Caused by: java.io.IOException: null
    at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:105) ~[amqp-client-4.0.3.jar:4.0.3]
    at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:101) ~[amqp-client-4.0.3.jar:4.0.3]
    at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:123) ~[amqp-client-4.0.3.jar:4.0.3]
    at com.rabbitmq.client.impl.ChannelN.queueDeclarePassive(ChannelN.java:992) ~[amqp-client-4.0.3.jar:4.0.3]
    at com.rabbitmq.client.impl.ChannelN.queueDeclarePassive(ChannelN.java:50) ~[amqp-client-4.0.3.jar:4.0.3]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_131]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_131]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_131]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_131]
    at org.springframework.amqp.rabbit.connection.CachingConnectionFactory$CachedChannelInvocationHandler.invoke(CachingConnectionFactory.java:1027) ~[spring-rabbit-1.7.9.RELEASE.jar:na]
    at com.sun.proxy.$Proxy261.queueDeclarePassive(Unknown Source) ~[na:na]
    at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.attemptPassiveDeclarations(BlockingQueueConsumer.java:700) ~[spring-rabbit-1.7.9.RELEASE.jar:na]
    ... 3 common frames omitted
Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=404, reply-text=NOT_FOUND - no queue 'miaosha.queue' in vhost '/', class-id=50, method-id=10)
    at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:66) ~[amqp-client-4.0.3.jar:4.0.3]
    at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:32) ~[amqp-client-4.0.3.jar:4.0.3]
    at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:366) ~[amqp-client-4.0.3.jar:4.0.3]
    at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:229) ~[amqp-client-4.0.3.jar:4.0.3]
    at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:117) ~[amqp-client-4.0.3.jar:4.0.3]
    ... 12 common frames omitted

solution

miaosha.queue queue could not be found, an inspection found that the queue was not configured in the @configuration file,

add the relevant queue to the configuration class to

@Configuration
public class MQConfig {

    public static final String MIAOSHA_QUEUE = "miaosha.queue";

    @Bean
    public Queue miaoShaQueue(){
        return new Queue(MIAOSHA_QUEUE,true);
    }
}