Solving a problem where messages in rabbitmq queues cannot be consumed
Solving a problem where messages in rabbitmq queues cannot be consumed
Problem Description:
Producer sends message to queue successfully, but the message in the queue is never consumed
Problem Analysis:
autotroph (original producers in a food chain)
msgserver service
configuration file
As you can see, in addition to its own configuration information about rabbimq, the msgserver service calls the configuration file for the QA2 environment in the configserver Unified Configuration Center service.
The msgserver service uses the JavaConfig configuration method to configure RabbitMQ configuration information
From the above procedure you can see that the configured RabbitMQ virtual address is /
This service that produces messages has four queues, one of which is called queue_sendemail
The above is basically the message generated is put into the queue_sendemail queue
consumers
proxyserver service
configuration file
Configuration files for Spring integration with RabbitMQ
From this you can see that RabbitMQ’s virtual address is host_qa
The consumer listening to this queue is emailSendListener.
The problem:
Looked at the above two about RibbitMQ configuration, found the problem, the two services are configured with the same message queue, but their virtual addresses are not the same, the producer only sends messages to the queue, but the consumer end of the listener is not the virtual address of the queue, and therefore can not consume the message!
Solution:
Just make the virtual addresses of the above two microservices uniform,
Summary:
The use of the RabbitMQ backend management interface is a very important thing.
Read more here: Source link
