/** * Remove queue(s) from this container's list of queues. * @param queueNames The queue(s) to remove. * @return the boolean result of removal on the target {@code queueNames} List. */ public boolean removeQueueNames(String... queueNames) { Assert.notNull(queueNames, "'queueNames' cannot be null"); Assert.noNullElements(queueNames, "'queueNames' cannot contain null elements"); if (this.queues.size() > 0) { Set<String> toRemove = new HashSet<>(Arrays.asList(queueNames)); return this.queues.removeIf( q -> toRemove.contains(q.getActualName())); } return false; }
/** * Remove queue(s) from this container's list of queues. * @param queueNames The queue(s) to remove. * @return the boolean result of removal on the target {@code queueNames} List. */ public boolean removeQueueNames(String... queueNames) { Assert.notNull(queueNames, "'queueNames' cannot be null"); Assert.noNullElements(queueNames, "'queueNames' cannot contain null elements"); if (this.queues.size() > 0) { Set<String> toRemove = new HashSet<>(Arrays.asList(queueNames)); return this.queues.removeIf( q -> toRemove.contains(q.getActualName())); } return false; }
if (queue != null && !StringUtils.hasText(queue.getName())) { String actualName = queue.getActualName(); if (StringUtils.hasText(actualName)) { namesToQueues.remove(consumer.getQueue());
if (queue != null && !StringUtils.hasText(queue.getName())) { String actualName = queue.getActualName(); if (StringUtils.hasText(actualName)) { namesToQueues.remove(consumer.getQueue());
private void testBrokerNamedQueue(AbstractMessageListenerContainer container, CountDownLatch latch1, CountDownLatch latch2, Queue queue) throws Exception { container.start(); String firstActualName = queue.getActualName(); this.message.set(null); this.template.convertAndSend(firstActualName, "foo"); assertThat(latch1.await(10, TimeUnit.SECONDS)).isTrue(); assertThat(this.message.get().getBody()).isEqualTo("foo".getBytes()); final CountDownLatch newConnectionLatch = new CountDownLatch(2); this.cf.addConnectionListener(c -> newConnectionLatch.countDown()); this.cf.resetConnection(); assertThat(newConnectionLatch.await(10, TimeUnit.SECONDS)).isTrue(); String secondActualName = queue.getActualName(); assertThat(secondActualName).isNotEqualTo(firstActualName); this.message.set(null); this.template.convertAndSend(secondActualName, "bar"); assertThat(latch2.await(10, TimeUnit.SECONDS)).isTrue(); assertThat(this.message.get().getBody()).isEqualTo("bar".getBytes()); container.stop(); }