Skip to content
Advertisement

How to create dynamic queues in rabbit mq using spring boot?

I need some help.

I’m developing a spring boot application, and I want wo publish messages to a rabbitMQ. I want to send it to a queue, that is named in the message itself. This way i want to create queues dynamicly. I only found examples that use a “static” queue.

I have reserched some things but didn’t find anything. I’m new to RabbitMQ and learned the basic concepts. I’m also fairly new to spring.

RabbotMQ Config

JavaScript

MessageSender

JavaScript

Advertisement

Answer

I came to a solution:

You need to create a AmqpAdmin in your config:

JavaScript

Then you add it to your service:

JavaScript

Finally you can use it to create queues and bindings.

JavaScript

I found the solution here

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement