private boolean isQueueRunning() { if (SimpleMessageListenerContainer.this.runningStateByQueue.containsKey(this.logicalQueueName)) { return SimpleMessageListenerContainer.this.runningStateByQueue.get(this.logicalQueueName); } else { getLogger().warn("Stopped queue '" + this.logicalQueueName + "' because it was not listed as running queue."); return false; } } }
private boolean isQueueRunning() { if (SimpleMessageListenerContainer.this.runningStateByQueue.containsKey(this.logicalQueueName)) { return SimpleMessageListenerContainer.this.runningStateByQueue.get(this.logicalQueueName); } else { getLogger().warn("Stopped queue '" + this.logicalQueueName + "' because it was not listed as running queue."); return false; } } }
private void applyDeletionPolicyOnError(String receiptHandle, MessagingException messagingException) { if (this.deletionPolicy == SqsMessageDeletionPolicy.ALWAYS || (this.deletionPolicy == SqsMessageDeletionPolicy.NO_REDRIVE && !this.hasRedrivePolicy)) { deleteMessage(receiptHandle); } else if (this.deletionPolicy == SqsMessageDeletionPolicy.ON_SUCCESS) { getLogger().error("Exception encountered while processing message.", messagingException); } }
private void applyDeletionPolicyOnError(String receiptHandle, MessagingException messagingException) { if (this.deletionPolicy == SqsMessageDeletionPolicy.ALWAYS || (this.deletionPolicy == SqsMessageDeletionPolicy.NO_REDRIVE && !this.hasRedrivePolicy)) { deleteMessage(receiptHandle); } else if (this.deletionPolicy == SqsMessageDeletionPolicy.ON_SUCCESS) { getLogger().error("Exception encountered while processing message.", messagingException); } }
private void waitForRunningQueuesToStop() { for (Map.Entry<String, Boolean> queueRunningState : this.runningStateByQueue.entrySet()) { String logicalQueueName = queueRunningState.getKey(); Future<?> queueSpinningThread = this.scheduledFutureByQueue.get(logicalQueueName); if (queueSpinningThread != null) { try { queueSpinningThread.get(getQueueStopTimeout(), TimeUnit.MILLISECONDS); } catch (ExecutionException | TimeoutException e) { getLogger().warn("An exception occurred while stopping queue '" + logicalQueueName + "'", e); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } } }
private void waitForRunningQueuesToStop() { for (Map.Entry<String, Boolean> queueRunningState : this.runningStateByQueue.entrySet()) { String logicalQueueName = queueRunningState.getKey(); Future<?> queueSpinningThread = this.scheduledFutureByQueue.get(logicalQueueName); if (queueSpinningThread != null) { try { queueSpinningThread.get(getQueueStopTimeout(), TimeUnit.MILLISECONDS); } catch (ExecutionException | TimeoutException e) { getLogger().warn("An exception occurred while stopping queue '" + logicalQueueName + "'", e); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } } }
/** * Stops and waits until the specified queue has stopped. If the wait timeout specified by {@link SimpleMessageListenerContainer#getQueueStopTimeout()} * is reached, the current thread is interrupted. * * @param logicalQueueName * the name as defined on the listener method */ 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); } }
/** * Stops and waits until the specified queue has stopped. If the wait timeout specified by {@link SimpleMessageListenerContainer#getQueueStopTimeout()} * is reached, the current thread is interrupted. * * @param logicalQueueName * the name as defined on the listener method */ 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); } }
getLogger().warn("An Exception occurred while polling queue '{}'. The failing operation will be " + "retried in {} milliseconds", this.logicalQueueName, getBackOffTime(), e); try {
getLogger().warn("An Exception occurred while polling queue '{}'. The failing operation will be " + "retried in {} milliseconds", this.logicalQueueName, getBackOffTime(), e); try {