springboot stomp rabbitmq Error: payload=non-loopback access denied [How to Solve]

Recently, I encountered a problem when deploying springboot stomp rabbitmq. Record the troubleshooting process:

2022-01-29 17:02:15.700 ERROR 172512 --- [ent-scheduler-4] o.s.m.s.s.StompBrokerRelayMessageHandler : Received ERROR {message=[Bad CONNECT], content-type=[text/plain], version=[1.0,1.1,1.2], content-length=[26]} session=_system_ text/plain payload=non-loopback access denied


The first problem is to find the answer on stackoverflow:



According to the instructions, a problem was found. The guest user is only allowed to access from localhost. My rabbitmq is deployed on another virtual machine, and the web service is another virtual machine, so this error is revealed.


View loopback_Users means that setting it to none allows guest users to access remotely.

Check the location of rabbitmq’s configuration file and search for config files

rabbitmq-diagnostics status

I use version 3.7. There is no config files information in the command. By checking rabbitmq startup log, it is found that:

Config files: none


So specify the rabbitmq configuration file (note that the last rabbitmq here refers to the configuration file without .conf)

echo "CONFIG_FILE=/usr/local/software/rabbitmq_software/rabbitmq_server-3.7.16/etc/rabbitmq/rabbitmq" > /etc/rabbitmq/rabbitmq-env.conf

echo "loopback_users = none" > /etc/rabbitmq/rabbitmq.conf


Restart rabbitmq

rabbitmqctl stop

rabbitmq-server -detached


Check the startup file and confirm that the configuration file is loaded

Our program has also been successfully connected

Similar Posts: