AWS SQS integration in Mendix

0
I am using AWS SQS service to receive messages but currently its allowing me to receive only 10 messages at a time so I have put that activity in a while (counter <100 ) loop so it will iterate through that receive message 100 times or and inside the loop I am breaking it if no messages has been retrieved at that iteration but the issue here is Iam not getting consistent number of count sometimes it will be 10(max), 1, 5 or even 0 when 0 comes its breaking so how to get 10 messages in each iteration and also is there a possibility to receive all messages at once from the queue it would be great this way if possible.     Thanks in advance :)
asked
1 answers
0

Dear Chethan,

 

I'm Trong, a developer from the team that developed the AWS connectors available on the Mendix Marketplace. Thank you for reaching out with your query.

 

To address your question, the service indeed has a set limit of retrieving a maximum of 10 messages per ReceiveMessage operation, making it impossible to receive all messages at once.

 

Additionally, it seems you are experiencing inconsistency in your looping condition due to the varying number of messages received in the ReceiveMessage operation. This is a known behavior of the service; Amazon SQS API reference & Mendix Docs.

 

However, I'd like to propose a different implementation approach. Consider using the GetQueueAttributes operation. This operation allows you to retrieve the approximate number of messages available for retrieval in a specified queue. Although this number is an approximation, it can provide a more consistent basis looping condition. By doing so, your Mendix application can be configured to retrieve messages whenever it is approximated that messages are available. This approach should help in making your application's message retrieval process more efficient and consistent.

 

If you have any further questions, please don't hesitate to respond to this thread. Additionally, I encourage you to share your results or details of your implementation. Both follow-up questions and information about your implementation can help others in the community that are facing similar issues.

 

Best,

Trong

answered