@@ -266,7 +266,7 @@ public Consumer createConsumer(Connection connection, Stats stats, String id) th
266266 public boolean shouldConfigureQueues () {
267267 // don't declare any queues when --predeclared is passed,
268268 // otherwise unwanted server-named queues without consumers will pile up. MK.
269- return consumerCount == 0 && !predeclared && ! (queueNames .size () == 0 );
269+ return consumerCount == 0 && !(queueNames .size () == 0 );
270270 }
271271
272272 public List <String > configureQueues (Connection connection , String id ) throws IOException {
@@ -275,7 +275,11 @@ public List<String> configureQueues(Connection connection, String id) throws IOE
275275 channel .exchangeDeclare (exchangeName , exchangeType );
276276 }
277277 // To ensure we get at-least 1 default queue:
278- if (queueNames .isEmpty ()) {
278+ // (don't declare any queues when --predeclared is passed,
279+ // otherwise unwanted server-named queues without consumers will pile up.
280+ // see https://github.com/rabbitmq/rabbitmq-perf-test/issues/25 and
281+ // https://github.com/rabbitmq/rabbitmq-perf-test/issues/43)
282+ if (!predeclared && queueNames .isEmpty ()) {
279283 queueNames .add ("" );
280284 }
281285 List <String > generatedQueueNames = new ArrayList <String >();
@@ -288,7 +292,10 @@ public List<String> configureQueues(Connection connection, String id) throws IOE
288292 queueArguments ).getQueue ();
289293 }
290294 generatedQueueNames .add (qName );
291- channel .queueBind (qName , exchangeName , id );
295+ // not allowed to bind to the default exchange
296+ if (!"" .equals (exchangeName ) && !"amq.default" .equals (exchangeName )) {
297+ channel .queueBind (qName , exchangeName , id );
298+ }
292299 }
293300 channel .abort ();
294301
0 commit comments