nexylan / graylog-rabbitmq

MIT License
6 stars 5 forks source link

Queue not created as durable despite "Durable?" checkbox being selected #11

Open Paul-Sorensen-Epicure opened 4 years ago

Paul-Sorensen-Epicure commented 4 years ago

Hello,

I have tested with the "Durable?" checkbox either being selected or not, and the queue is not ever being created as "Durable". If the checkbox is selected, the queue is created as "excl" (Exclusive).

Graylog version 2.4.3 RabbitMQ version 3.6.11

Paul-Sorensen-Epicure commented 4 years ago

You are setting the "Durable" parameter in the wrong spot

From the RabbitMQ docs https://rabbitmq.github.io/rabbitmq-java-client/api/4.x.x/com/rabbitmq/client/impl/recovery/AutorecoveringChannel.html#queueDeclare(java.lang.String,boolean,boolean,boolean,java.util.Map)

public AMQP.Queue.DeclareOk queueDeclare​(String queue, boolean durable, boolean exclusive, boolean autoDelete, Map<String,​Object> arguments) throws IOException

You can see here that the "durable" boolean is the 2nd parameter.

From your code: https://github.com/nexylan/graylog-rabbitmq/blob/master/src/main/java/net/nexylan/graylog/rabbitmq/senders/RabbitMQSender.java

Line 93:

this.channel.queueDeclare(this.queue, false, this.durable, false, null);

You can see here that "Durable" (the 2nd parameter) is always being set to false, and instead of setting "Durable" you are setting "Exclusive" using the " this.durable" boolean value.

henri9813 commented 4 years ago

Hello,

Well done ! I will give a look this week to publish a bugfix,

Happy new Year ! :)

Best regards,