Skip to content
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

feat: updating ProducerOptions to use QueueUrl hostname #102

Conversation

mogu4iy
Copy link
Contributor

@mogu4iy mogu4iy commented Mar 6, 2024

Resolves #NUMBER

Description:
Add useQueueUrlAsEndpoint support in Producer initialization
Type of change:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Why is this change required?:

Let use QueueUrl hostname as the endpoint with @aws-sdk/client-sqs@^v3.507.0

Code changes:

Add useQueueUrlAsEndpoint to ProducerOptions, so it can be passed to SQSClient.
Add useQueueUrlAsEndpoint check in Producer constructor to pass true as default value.


Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@mogu4iy mogu4iy requested review from a team as code owners March 6, 2024 18:31
Copy link

github-actions bot commented Mar 6, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@mogu4iy
Copy link
Contributor Author

mogu4iy commented Mar 6, 2024

I have read the CLA Document and I hereby sign the CLA

src/producer.ts Outdated Show resolved Hide resolved
@@ -5,6 +5,7 @@ export interface ProducerOptions {
batchSize?: number;
sqs?: SQSClient;
region?: string;
useQueueUrlAsEndpoint?: boolean;
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if it's better just to extend SQS' native types here rather than implementing a new type every time they have a new option.

Copy link
Contributor Author

@mogu4iy mogu4iy Mar 6, 2024

Choose a reason for hiding this comment

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

It can be extended if it's ok to update @aws-sdk/client-sqs version to at least 3.507 where this functionality was added.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this way handler can be passed, that is not what we what from producer

Copy link
Member

Choose a reason for hiding this comment

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

Sure, we can look at this comment separately, just a comment on future prosperity.

Copy link
Member

Choose a reason for hiding this comment

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

Note to self: After merging I think that our types need some comments and documentation like we have for sqs-consumer.

@nicholasgriffintn nicholasgriffintn added this to the v5.0.0 milestone Mar 11, 2024
@nicholasgriffintn nicholasgriffintn merged commit 370c363 into bbc:main Mar 11, 2024
6 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants