-
-
Notifications
You must be signed in to change notification settings - Fork 316
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
Can not receive sqs message after the application has been running for a few hours/days #551
Comments
@ramyogi7283, this is a known issue with the Feel free to try Thanks. |
@tomazfernandes I am exploring 3.0.0-RC1 as you mentioned. SQSListener does not accept list of name through SpEL (#678) so I submitted issues already , I have few clarification. I would like to create individual container for each queue name so that I can stop and start container based upon queue name. @bean So when I create a container like above this DefaultListenerContainerRegistry cannot be used ? I am really impressed with latest AWSSPRING but documentation not enough to understand better. |
Hi @ramyogi7283! Thanks a lot for trying it out and providing feedback, this helps us a lot. As mentioned in this section of the documentation, the However you can also manually register the containers in the provided public interface MessageListenerContainerRegistry extends SmartLifecycle {
/**
* Register a {@link MessageListenerContainer} instance with this registry.
* @param listenerContainer the instance.
*/
void registerListenerContainer(MessageListenerContainer<?> listenerContainer);
/**
* Return the {@link MessageListenerContainer} instances registered within this registry.
* @return the container instances.
*/
Collection<MessageListenerContainer<?>> getListenerContainers();
/**
* Return the {@link MessageListenerContainer} instance registered within this registry with the provided id, or
* null if none.
* @param id the id.
* @return the container instance.
*/
@Nullable
MessageListenerContainer<?> getContainerById(String id);
} Just mind that if you use the default registry, it'll apply its bean lifecycle hooks on all registered containers e.g. Does this answer your question? If so maybe we can add this clarification to the docs. Thanks! |
@tomazfernandes Please provide example how to register container if manually created containers. and access MessageListenerContainerRegistry. |
@ramyogi7283, you can autowire the default |
Type: Can not receive sqs message after the application has been running for a few days
Component:
SQS
Describe the bug
io.awspring.cloud spring-cloud-aws-dependencies 2.3.1 pom importAfter the application runs for a few days, listener can not receive the message and I saw the count of messages in the queue growing in the Amazon admin. The application runs normally only sqs listener not receive message. After I restart application then it worked well again.
Sample
@SqsListener(value = "#{sqsQueueNameReader.listQueueNames()}", deletionPolicy = SqsMessageDeletionPolicy.ON_SUCCESS)
public void consumeSQSMessage(String payload, @headers Map<String, String> headers) {
Message message = MessageBuilder.withPayload(payload).copyHeaders(headers).build();
consumeMessage(message);
}
Reference :
spring-attic/spring-cloud-aws#742
The text was updated successfully, but these errors were encountered: