Closed michaelparkadze closed 3 years ago
Update: I read about handleMessageBatch and passed it in the new SqsConsumer and added it in the constructor of the class and I am still having the processes handled one at a time and not parallel.
I ran some more test and I found one that even though my batchSize was for example 5, I only got 2 messages in the batch even though there were more in the queue itself. I found that this might happen in the amazon receiveMessage page:
MaxNumberOfMessages: "Amazon SQS never returns more messages than this value (however, fewer messages might be returned). Valid values: 1 to 10. Default: 1. "
So I assume the same might happen in this situation.
I am trying to use sqs-consumer to process multiple messages in parallel and for some reason I can not get it to work, so I hope someone could show me what I am doing wrong here.
Here is the code example:
SqsConsumer class
Example subscriber:
Even though the batchSize is 5 the 'response_processed' log gets logged each time a single process is done. Thanks in advance.