How scale a Elasticbeanstalk application worker on based on messages from SQS?

早过忘川 提交于 2019-12-13 07:37:43

问题


I have a Scala application to do some heavy calculation based on customer_id, I'm putting customers id in SQS (Amazon Simple Queue Service), the application it is configured on ElastikBeansTalk to consume msg from SQS.

I would like to scale my application based on message coming from SQS, the problem is my application is running as HTTP server and it return 200 code after finishing the calculation, which minimum takes 15min.

SQS max timeout is 60 seconds, so after that, all msgs ended up in Dead Letter queue, I tried to send a 200 response code before finishing the calculation, but it receives another message from the queue and starts another process.

Any solution, please ?

EDIT: example of my worker configuration:

Thank you in advance !


回答1:


The max VisibilityTimeout is 12 hours. So you could put it to 30 minutes and that should cover your case.




回答2:


Well, the issue is not from Akka HTTP Server or either from SQS,it's coming from default nginx conf. Issue resolved by editing the default proxy_read_timeout which 60s to the value desired.



来源:https://stackoverflow.com/questions/39854611/how-scale-a-elasticbeanstalk-application-worker-on-based-on-messages-from-sqs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!