Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws spring cloud 3.x : There is no queue stop timeout, that is creating problems by increasing buid timeout. #1077

Open
VaibhavTheVicar opened this issue Mar 8, 2024 · 2 comments
Labels
component: sqs SQS integration related issue status: waiting-for-feedback Waiting for feedback from issuer

Comments

@VaibhavTheVicar
Copy link

Type: Feature

Is your feature request related to a problem? Please describe.
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);
	}
}

There used to be a queueStopTimeout in the previous version, that let us, shut the queue down by interrupting the thread, when the application shuts down. In v3

@Override
public void stop() {
	if (!this.isRunning) {
		return;
	}
	logger.debug("Stopping container {}", this.id);
	synchronized (this.lifecycleMonitor) {
		this.isRunning = false;
		doStop();
	}
	logger.info("Container {} stopped", this.id);
}

Please advice if this exists, leave implementation, do you see a "hacky" way?

Another hacky thing I had to do: #1055

@VaibhavTheVicar
Copy link
Author

@maciejwalkowiak

@tomazfernandes
Copy link
Contributor

@VaibhavTheVicar , please take a look at the ContainerOptions.

You'll find listenerShutdownTimeout and acknowledgementShutdownTimeout there which you can configure to achieve your goal. Set to Duration.ZERO if you don't want any wait.

Let me know if that works for you.

@tomazfernandes tomazfernandes added component: sqs SQS integration related issue status: waiting-for-feedback Waiting for feedback from issuer labels Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: sqs SQS integration related issue status: waiting-for-feedback Waiting for feedback from issuer
Projects
None yet
Development

No branches or pull requests

2 participants