8000 [ESM] Provide SqsPoller with default parameters by gregfurman · Pull Request #12240 · localstack/localstack · GitHub
[go: up one dir, main page]

Skip to content

[ESM] Provide SqsPoller with default parameters #12240

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 1 commit into from
Feb 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,19 @@ def __init__(
super().__init__(source_arn, source_parameters, source_client, processor)
self.queue_url = get_queue_url(self.source_arn)

self.batch_size = self.sqs_queue_parameters["BatchSize"]
self.maximum_batching_window = self.sqs_queue_parameters["MaximumBatchingWindowInSeconds"]
self.batch_size = self.sqs_queue_parameters.get("BatchSize", DEFAULT_MAX_RECEIVE_COUNT)
# HACK: When the MaximumBatchingWindowInSeconds is not set, just default to short-polling.
# While set in ESM (via the config factory) setting this param as a default in Pipes causes
# parity issues with a retrieved config since no default value is returned.
self.maximum_batching_window = self.sqs_queue_parameters.get(
"MaximumBatchingWindowInSeconds", 0
)

self._register_client_hooks()

@property
def sqs_queue_parameters(self) -> PipeSourceSqsQueueParameters:
# TODO: De-couple Poller configuration params from ESM/Pipes specific config (i.e PipeSourceSqsQueueParameters)
return self.source_parameters["SqsQueueParameters"]

@cached_property
Expand Down
Loading
0