Skip to content

Conversation

@tavakara
Copy link

This pull request fixes the issue report in #9.

@crojasqnextroll
Copy link

Hi @tavakara this PR makes sense to me, were you able to get a better throughput rate with this change?

@abhishekd0907
Copy link
Collaborator

@tavakara
SQSClient doesn't fetch one message per request but a list of messages. However, due to the current code, there is a minimum delay of one second between two requests. I am happy to accept a change that will make this delay configurable in milliseconds as compared to seconds.

However, I would like to point out that the advisable way of polling SQS is to minimize the frequency of polling and fetch the maximum possible messages per request in order to save costs. Also, keep in mind that polling SQS too frequently by your client may lead to throttling and give 429 errors as discussed here Stackoverflow

sqsScheduler.scheduleWithFixedDelay(
sqsFetchMessagesThread,
0,
sqsFetchIntervalSeconds,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please change the variable names in code / tests and documentation accordingly to milliseconds to avoid confusion

@sujeet-srivastava
Copy link

sujeet-srivastava commented Apr 6, 2021

I changed the sqsFetchInterval to accept milliseconds: see here - https://github.com/sujeet-srivastava/s3-sqs-connector

Tested as below:

  • Added 4890 (total size =10Gb) files to a bucket linked up to a Queue
  • Created a streaming sql query from this Queue to dump the content into another location after minor processing
  • I could achieve a message receive rate at 3.6k messages/sec in SQS with fetchInterval set to 10 millisec
  • did not see throttling
  • no data loss.
  • The limit to seconds seems unnecessary

This fix is needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants