Search code examples
spring-bootrabbitmq

Is there a way to set a queue name in rabbitTemplate with spring-boot?


I am trying to set a queue name with rabbitTemplate. Is there a way to do that?

Trying to set a queue name with rabbitTemplate.

Try the rabbitTemplate.convernAndSend method but u cant set the queueName.

Am i need other methods to doing that.


Solution

  • I cant find any solution with rabbitTemplate. rabbitAdmin solve my problem.

    RabbitAdmin rabbitAdmin = new RabbitAdmin(rabbitConnectionFactory);
    rabbitAdmin.declareQueue(queue);
    rabbitAdmin.declareBinding(binding);