Skip to content

Commit 798e57b

Browse files
authored
Merge pull request #35 from AlexShvedoff/autoDelete-non-durable-topic-broker-queues
set the auto-delete to true for broker queues created to support non-…
2 parents 7854597 + 46864fb commit 798e57b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/com/rabbitmq/jms/client/RMQSession.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,10 @@ private void declareRMQQueue(RMQDestination dest, String queueNameOverride, bool
822822
this.channel.queueDeclare(queueName,
823823
durable,
824824
exclusive,
825-
false, // autoDelete - exclusive takes care of this
825+
/* broker queues declared for a non-durable topic that have an auto-generated name must go down with
826+
consumer/producer or the broker will leak them until the connection is brought down
827+
*/
828+
!durable && queueNameOverride != null && !dest.isQueue(), // autoDelete
826829
options); // object properties
827830

828831
/* Temporary or 'topic queues' are exclusive and therefore get deleted by RabbitMQ on close */

0 commit comments

Comments
 (0)