Skip to content

Commit 58cb100

Browse files
author
Simon MacMullen
committed
Yes, you can use a server-named queue without using queueDeclare/0.
1 parent 15158f0 commit 58cb100

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/src/com/rabbitmq/examples/MulticastMain.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ public static void main(String[] args) {
105105
Channel channel = conn.createChannel();
106106
if (consumerTxSize > 0) channel.txSelect();
107107
channel.exchangeDeclare(exchangeName, exchangeType);
108-
String queueName = "consumer-" + UUID.randomUUID();
109-
channel.queueDeclare(queueName, flags.contains("persistent"),
110-
true, false, null);
108+
String queueName =
109+
channel.queueDeclare("", flags.contains("persistent"),
110+
true, false, null).getQueue();
111111
QueueingConsumer consumer = new QueueingConsumer(channel);
112112
if (prefetchCount > 0) channel.basicQos(prefetchCount);
113113
channel.basicConsume(queueName, autoAck, consumer);

0 commit comments

Comments
 (0)