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

Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions src/producer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export class Producer {
this.validate(options);
this.queueUrl = options.queueUrl;
this.batchSize = options.batchSize || 10;
options.useQueueUrlAsEndpoint = options.useQueueUrlAsEndpoint ?? true;
nicholasgriffintn marked this conversation as resolved.
Show resolved Hide resolved
this.sqs =
options.sqs ||
new SQSClient({
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.

}

export interface Message {
Expand Down
Loading