Closed shresthaujjwal closed 2 years ago
Another update. I limited the MaxNumberOfMessages
consumption to 5 but even that didn't help. It ran little longer but it still ranout of memory at the end
@Bean
public SimpleMessageListenerContainerFactory simpleMessageListenerContainerFactory(Optional<AmazonSQSAsync> amazonSQSAsync) {
if (amazonSQSAsync.isPresent()) {
SimpleMessageListenerContainerFactory factory = new SimpleMessageListenerContainerFactory();
factory.setAmazonSqs(amazonSQSAsync.get());
factory.setAutoStartup(true);
factory.setMaxNumberOfMessages(5);
factory.setWaitTimeOut(10);
factory.setBackOffTime(Long.valueOf(60000));
return factory;
} else {
return null;
}
}
closing this issue, as it turns out my application had a memory leak. Apologize for inconvenience
Thanks for update @shresthaujjwal
Type: Bug
Component:
SQS I am using Spring Cloud AWS version
2.4.0
+ Spring Boot version2.7.0
Java VersionDescribe the bug Please provide details of the problem, including the version of Spring Cloud that you are using. I started Q&A thread about how to control the thread but i feel this is a bug. As stated in the discussion thread Limit SQS Concurrency and/or control thread exhaustion, i have a simple microservice that consumes messages. Here is my setup
I thought i have too many container so i decided to reduce that to just 1 container with 4GB (same instance size), even after doing that i ran into thread issue.
Followed by this error
I ran
ps -elfT | wc -l
and noticed thread count keep growing and doesn't come down even after message is processed.Sample Sample Code
I also have this converter registered as bean to handle payload and a bean to handle proxy.
Please advise.