RabbitMQ queue gets deleted immediately after creation. Why?

7/4/2020

I'm trying to deploy Spring Boot microservices applications producing and consuming data using RabbitMQ on K8s Cluster in Azure AKS. When I run producer application and produce a message to the queue through POSTMAN, I get 200 OK response but in RabbitMQ management UI, I get no queues and in the RabbitMQ container logs I see below error

o.s.a.r.c.CachingConnectionFactory : Channel shutdown: channel error; protocol method: #method<channel.close>(reply-code=404, reply-text=NOT_FOUND - no exchange 'employeeexchange' in vhost '/', class-id=60, method-id=40)

Not able to figure out what I'm doing wrong. If you have any idea (or need any kind of additional information), let me know.

-- Meghna
azure-aks
azure-cloud-services
kubernetes
rabbitmq
spring-boot

1 Answer

7/4/2020

You can use below to create a queue

@Bean
Queue queue() {
return new Queue(String name, boolean durable, boolean exclusive, boolean autoDelete)

Parameters:

name - the name of the queue.

durable - true if we are declaring a durable queue (the queue will survive a server restart)

exclusive - false if we are not declaring an exclusive queue (the queue will only be used by the declarer's connection)

autoDelete - false if the server should not delete the queue when it is no longer in use

-- Arghya Sadhu
Source: StackOverflow