serverless-plugins
serverless-plugins copied to clipboard
ReadCountOutOfRange; see the SQS docs w/ sqs.batchSize > 1
Running serverless 2.19.0 offline w/ "serverless-offline-sqs": "4.1.1",
- sqs:
arn: <myqueuearn>
batchSize: 50
maximumBatchingWindow: 30
Serverless: [AWS sqs 400 0.152s 0 retries] receiveMessage({
QueueUrl: 'http://localhost:9324/queue/my-queue',
MaxNumberOfMessages: 50,
AttributeNames: [ 'All', [length]: 1 ],
MessageAttributeNames: [ 'All', [length]: 1 ],
WaitTimeSeconds: 5
})
Read Count Out Of Range --------------------------------
ReadCountOutOfRange: ReadCountOutOfRange; see the SQS docs.
if set to batchSize: 1
it works
It appears I've hit this as well. Setting batchSize
to 100 for instance causes the ReadCountOutOfRange
error but 10 or below it's fine. I would expect this for an SQS source trigger on a FIFO queue but not a standard queue. Is this perhaps a side effect of the underlying use of ElasticMQ?
Took me a while to find this one ... If anyone else comes across this problem of ReadCountOutOfRange
when using a batch size higher than 10, this is the default "strict" setting on ElasticMQ's sqs-limits. The default limit is 10, see here StrictSQSLimits & RelaxedSQSLimits
By setting sqs-limit : relaxed
in your elasticmq.conf you should be able to set the batchSize to 100 or more. This can be seen in the example config as well. Hope this helps!
Adding the following to elasticmq.conf did not work for me:
rest-sqs {
sqs-limit = relaxed
}
I'm using "serverless-offline-sqs": "^6.0.0"
@bezreyhan
might be late to the party but it's sqs-limits
and not sqs-limit
no idea if the property changed name or just a typo but hope it helps anyone else reading this issue
rest-sqs {
sqs-limits = relaxed
}