@Test void stop_withQueueNameThatDoesNotExist_throwsAnException() throws Exception { SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(); container.setAmazonSqs(mock(AmazonSQSAsync.class, withSettings().stubOnly())); container.setMessageHandler(new QueueMessageHandler()); container.afterPropertiesSet(); assertThatThrownBy(() -> container.stop("foo")) .isInstanceOf(IllegalArgumentException.class).hasMessageContaining("foo"); }
public void stop(String logicalQueueName) { stopQueue(logicalQueueName); try { if (isRunning(logicalQueueName)) { Future<?> future = this.scheduledFutureByQueue.remove(logicalQueueName); if (future != null) { future.get(this.queueStopTimeout, TimeUnit.MILLISECONDS); } } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } catch (ExecutionException | TimeoutException e) { getLogger().warn("Error stopping queue with name: '" + logicalQueueName + "'", e); } }
SimpleMessageListenerContainer extends AbstractMessageListenerContainer { public void stop(String logicalQueueName) { stopQueue(logicalQueueName); try { if (isRunning(logicalQueueName)) { Future<?> future = this.scheduledFutureByQueue.remove(logicalQueueName); if (future != null) { future.get(this.queueStopTimeout, TimeUnit.MILLISECONDS); } } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } catch (ExecutionException | TimeoutException e) { getLogger().warn("Error stopping queue with name: '" + logicalQueueName + "'", e); } } }
SimpleMessageListenerContainer extends AbstractMessageListenerContainer { public void stop(String logicalQueueName) { stopQueue(logicalQueueName); try { if (isRunning(logicalQueueName)) { Future<?> future = this.scheduledFutureByQueue.remove(logicalQueueName); if (future != null) { future.get(this.queueStopTimeout, TimeUnit.MILLISECONDS); } } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } catch (ExecutionException | TimeoutException e) { getLogger().warn("Error stopping queue with name: '" + logicalQueueName + "'", e); } }  }
SimpleMessageListenerContainer extends AbstractMessageListenerContainer { public void stop(String logicalQueueName) { stopQueue(logicalQueueName); try { if (isRunning(logicalQueueName)) { Future<?> future = this.scheduledFutureByQueue.remove(logicalQueueName); if (future != null) { future.get(this.queueStopTimeout, TimeUnit.MILLISECONDS); } } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } catch (ExecutionException | TimeoutException e) { getLogger().warn("Error stopping queue with name: '" + logicalQueueName + "'", e); } }  void setTaskExecutor(AsyncTaskExecutor taskExecutor); long getBackOffTime(); void setBackOffTime(long backOffTime); long getQueueStopTimeout(); void setQueueStopTimeout(long queueStopTimeout); void stop(String logicalQueueName); void start(String logicalQueueName); boolean isRunning(String logicalQueueName); }
SimpleMessageListenerContainer extends AbstractMessageListenerContainer { public void stop(String logicalQueueName) { stopQueue(logicalQueueName); try { if (isRunning(logicalQueueName)) { Future<?> future = this.scheduledFutureByQueue.remove(logicalQueueName); if (future != null) { future.get(this.queueStopTimeout, TimeUnit.MILLISECONDS); } } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } catch (ExecutionException | TimeoutException e) { getLogger().warn("Error stopping queue with name: '" + logicalQueueName + "'", e); } }  void setTaskExecutor(AsyncTaskExecutor taskExecutor); long getBackOffTime(); void setBackOffTime(long backOffTime); long getQueueStopTimeout(); void setQueueStopTimeout(long queueStopTimeout); void stop(String logicalQueueName); void start(String logicalQueueName); boolean isRunning(String logicalQueueName);  }