2
votes

Within my project, I have a group of remote nodes that have data on them that needs to be downloaded and set up a FIFO SQS queue and am able to push and pull message to/from it just fine to download the data.

Because these nodes are remote, they could have limited bandwidth so I use a MessageGroupId to enforce no more than 2 messages in flight per individual node to ensure we get no more than 2 concurrent connections at any given time.

Unfortunately, it seems that the only option available when calling receiveMessage() is MaxNumberOfMessages which ranges from 1-10 but also is equal to the number of MessageGroupId allowed in the response. So this means my receiveMessage() calls have to be 2 or less in order to prevent more than 2 concurrent connections to my remote nodes at once.

So my question here is, am I wrong? Someone please tell me I'm wrong and show me an option where I can set MaxNumberOfMessages = 10 and something like MessageGroupIdMax to 2 or something. I would prefer to pull 10 messages at a time and know I am only getting 2 per MessageGroupId so I don't have to call the queue so often.

Thanks in advance!

1
I don't think it's possible (i.e. you are right). I would go with sqs async client to optimize calls. See sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/…Sergey Romanovsky
Thanks, I guess I'll accept this terrible fate :)tatorface

1 Answers

0
votes

So we hired a consultant to basically confirm what I assumed. You cannot separate the number of messages received from the max number per Message Group Id, they are one in the same. To handle hundreds of message groups at one apiece, you just need a ton of workers processing the queue.