Skip to content

[SQS] Add custom header for overriding WaitTimeSeconds #12172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 10, 2025

Conversation

gregfurman
Copy link
Contributor

@gregfurman gregfurman commented Jan 23, 2025

Motivation

This PR allows the WaitTimeSeconds parameter to be overridden via a custom header. Useful for increasing the amount of time an SQS long polling request can collect for prior to returning.

Changes

  • New constant HEADER_LOCALSTACK_SQS_OVERRIDE_WAIT_TIME_SECONDS with x-localstack-sqs-override-wait-time-seconds.
  • Add support for replacing value of WaitTimeSeconds parameter with value of x-localstack-sqs-override-wait-time-seconds header.

@gregfurman gregfurman added aws:sqs Amazon Simple Queue Service semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases labels Jan 23, 2025
@gregfurman gregfurman added this to the 4.1 milestone Jan 23, 2025
@gregfurman gregfurman self-assigned this Jan 23, 2025
Copy link

github-actions bot commented Jan 23, 2025

LocalStack Community integration with Pro

    2 files  ±    0      2 suites  ±0   1h 14m 3s ⏱️ - 39m 9s
3 008 tests  - 1 083  2 877 ✅  - 898  131 💤  - 185  0 ❌ ±0 
3 010 runs   - 1 083  2 877 ✅  - 898  133 💤  - 185  0 ❌ ±0 

Results for commit 59b6b14. ± Comparison against base commit afb3931.

This pull request removes 1087 and adds 4 tests. Note that renamed tests count towards both.
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_lambda_dynamodb
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_opensearch_crud
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_search_books
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_setup
tests.aws.scenario.kinesis_firehose.test_kinesis_firehose.TestKinesisFirehoseScenario ‑ test_kinesis_firehose_s3
tests.aws.scenario.lambda_destination.test_lambda_destination_scenario.TestLambdaDestinationScenario ‑ test_destination_sns
tests.aws.scenario.lambda_destination.test_lambda_destination_scenario.TestLambdaDestinationScenario ‑ test_infra
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_prefill_dynamodb_table
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input0-SUCCEEDED]
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input1-SUCCEEDED]
…
tests.aws.services.sqs.test_sqs.TestSqsProvider ‑ test_send_receive_wait_time_seconds[sqs]
tests.aws.services.sqs.test_sqs.TestSqsProvider ‑ test_send_receive_wait_time_seconds[sqs_query]
tests.aws.services.sqs.test_sqs_backdoor.TestSqsOverrideHeaders ‑ test_receive_message_override_max_number_of_messages
tests.aws.services.sqs.test_sqs_backdoor.TestSqsOverrideHeaders ‑ test_receive_message_override_message_wait_time_seconds

♻️ This comment has been updated with latest results.

@gregfurman gregfurman force-pushed the add/sqs/override-header branch 6 times, most recently from 11fc7ee to af142d3 Compare January 27, 2025 11:46
@gregfurman gregfurman marked this pull request as ready for review January 27, 2025 12:34
@gregfurman gregfurman modified the milestones: 4.1, 4.2 Jan 29, 2025
@gregfurman gregfurman force-pushed the add/sqs/override-header branch from af142d3 to c591ea4 Compare February 4, 2025 09:09
@localstack-bot
Copy link
Collaborator

Currently, only patch changes are allowed on master. Your PR labels (aws:sqs, semver: minor) indicate that it cannot be merged into the master at this time.

@gregfurman gregfurman marked this pull request as draft February 4, 2025 14:25
@gregfurman gregfurman force-pushed the add/sqs/override-header branch 2 times, most recently from 307497c to 06db449 Compare February 7, 2025 10:05
@gregfurman gregfurman marked this pull request as ready for review February 7, 2025 11:48
@gregfurman gregfurman requested review from joe4dev and dfangl February 10, 2025 10:02
Copy link
Member

@dfangl dfangl left a comment

Choose a reason for hiding this comment

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

Just some minor questions, LGTM in general!

@gregfurman gregfurman force-pushed the add/sqs/override-header branch from baa35ef to 503b00a Compare February 10, 2025 13:32
@gregfurman gregfurman force-pushed the add/sqs/override-header branch from 503b00a to 9b42163 Compare February 10, 2025 13:33
@gregfurman gregfurman requested a review from dfangl February 10, 2025 13:38
Copy link
Member

@dfangl dfangl left a comment

Choose a reason for hiding this comment

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

Thanks for addressing my feedback so quickly, LGTM!

@gregfurman gregfurman merged commit dfe3575 into master Feb 10, 2025
31 checks passed
@gregfurman gregfurman deleted the add/sqs/override-header branch February 10, 2025 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws:sqs Amazon Simple Queue Service semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants