Performance Issue on RabbitMQ Cluster and Code Error when Connecting to the Cluster

16 views
Skip to first unread message

tap cloud

unread,
Jul 8, 2020, 3:14:03 AM7/8/20
to rabbitmq-discuss

I created a RabbitMQ cluster using Docker on 2 different VMs. The VMs are on Red Hat Linux 7.5. The commands used to create and start the cluster are:

docker run -d --hostname rabbitNode1 --name rabbit1 --add-host rabbitNode2:10.1.2.3 -p "4369:4369" -p "5672:5672" -p "15672:15672" -p "25672:25672" -p "35197:35197" -v "/home/user/rabbitmq-3:/var/lib/rabbitmq/mnesia/" -e "RABBITMQ_USE_LONGNAME=true" -e RABBITMQ_ERLANG_COOKIE="cooky" rabbitmq:3-management

The same docker command is run on another VM with the hostname, container name and IP address changed. Then to create a cluster, I ran the following commands on the first VM:

docker exec rabbit1 rabbitmqctl stop_app
docker
exec rabbit1 rabbitmqctl join_cluster rabbit@rabbit2
docker
exec rabbit1 rabbitmqctl start_app

The cluster was created successfully. But issues started to show up. First, the rabbitMQ web admin module loads very slowly. There is a significant lag time when loading the different pages within the admin module.

The second was using Springboot's AMQ implementation to connect to the rabbitMQ cluster. The code snippet is:

@Bean



protected Queue ackToProducerQueue() {

   
return new Queue(this.queueName, true);

}




@Bean

protected Binding bindAckToProducerQueue(Queue ackToProducerQueue, TopicExchange exchange) {

   
return BindingBuilder.bind(ackToProducerQueue).to(exchange).with(this.queueName);

}




@RabbitListener(queues = "#{ackToProducerQueue.name}")

@Override

protected void receiveMessage(DiodeBrokerMessage message) {

   
LoggerUtil.info(this.getClass(), "Message at " + queueName);

   processMessage
(message, outboxPath);

}


This produced the following connection exception:


Exception.png



The code exception appears only when trying to connect to the RabbitMQ cluster. On a single instance of RabbitMQ, the code works. The same occurs for the RabbitMQ web admin module. It runs fine on a single instance but on a cluster, there is a significant lag when loading the pages.


Is there any docker rabbitMQ setting and spring boot code which is missing or incorrect?


Reply all
Reply to author
Forward
0 new messages