Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring boot RabbitMQ Host string format

I am using spring boot to listen for messages on my rabbitmq instance. I have it working locally using an application.properties file.

However, when I want to connect to the remote rabbit instance I am getting number format exceptions and unknown host exceptions because of my url.

I've tried setting spring.rabbitmq.host to:

amqp://myurl/dev and myurl/dev and amqp%3A%2F%2Fmyurl%2Fdev

Nothing is working. Any ideas what could be up. I have set my user name and pass for the remote instance as well.

like image 395
user1026498 Avatar asked Aug 04 '26 00:08

user1026498


1 Answers

Try removing the amqp:// part. The host property should just be that, the hostname:

spring.rabbitmq.host=myurl

Not sure what the /dev part is. Are you saying that is your virtual-host? If so then just set this property too:

spring.rabbitmq.virtual-host=dev

For username/password, set these properties:

spring.rabbitmq.username=
spring.rabbitmq.password=
like image 99
jst Avatar answered Aug 07 '26 09:08

jst



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!