-
Notifications
You must be signed in to change notification settings - Fork 28
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
Empty virtual queues are not deleted #68
Comments
Hi, This depends on your configurations, there's a few things to keep in mind:
When creating a new Requester Client, the default value for the idle queue sweeping period is of 5 minutes. This means that every 5 minutes it will check for all queues beginning with the internal queue prefix for idleness. It checks 2 things:
If both those cases are true, then the idle queue will get deleted. Note: A Host queue will not get deleted by the idle queue sweeper By default, the heart beating mechanism will tag the queue every 5 seconds, the idle queue retention period is set to 5 minutes and the idle queue sweeping period is set to 5 minutes. This means that the queue will never get deleted even if it is idle, since the heart beat is keeping it alive.
In this example, we set the idle queue sweeping period to every minute, meaning it will check for idle queues every minute. The heart beat is set to every 7 minutes and by default the idle queue retention period is set to 5 minutes. Therefore on the 6th minute, if a virtual queue has been idle, it will get deleted by the idle queue sweeper. On send and receive message calls, the heart beat timestamp is updated, allowing the virtual queue to stay alive. |
Hi @adam-aws , what do you mean? I've got the configuration by default (heartbeat=5 sc, idleQueueRetention=5 min, idleQueueSweeping=5 min). With the configuration by default, all the temporary queues will never be idle? Which is the recommended configuration? |
The number of Temporary queues continues to increase, and on application client, we have a lot of log messages:
|
Can you try and update the configurations so that it fits your needs? So increasing the heartbeat interval to not have it do it every 5 seconds, since the sweeper runs every 5mins it wont get deleted. Also, a queue is only “idle” and automatically deleted if it is empty and has no traffic, including empty receives. |
@adam-aws , can you say me which is the recommended configuration? The default configuration makes SQS temporary queues to not work? If I increase the heartbeat from 5 seconds, what is the good value? any value greater than idle queue sweeper? And what about the exception that appears on my last comment? |
Yes correct, so you can configure the Idle Queue Retention Period if you want to make sure the queue stays alive for a certain time, even if idle (by default 5min). Then based on your needs, you can set the idle queue sweepers value (by default 5min) if you want the sweeper to check quicker or slower. Concerning the errors, seems like your application is using too many threads which is exceeding the AWS SDK limit. |
We have implemented a maven library, in order to manage all the Amazon services, and a requestor-responder pattern implemented, where the requestor, is a Grails application, and responder is a Spring-boot application. Both applications, use the same maven library to communicate with Amazon (S3, SQS, Personalize,...).
On each requestor and responder restart, the number of temporary queues increase, and exist a lot of pending messages:
Reading the documentation, I saw that empty temporary queues must to be deleted, after 5 minutes idle. In order to test it, I purged all the messages on temporary queues, and after 30 minutos, those queues are not deleted:
What is the problem? We are using amazon-sqs-java-temporary-queues-client version 1.2.1.
The text was updated successfully, but these errors were encountered: