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

Concurrent consumers support #232

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Conversation

kjamrog
Copy link
Collaborator

@kjamrog kjamrog commented Dec 11, 2024

Changes:

  • instead of operating on consumer field in AbstractSqsConsumer, we use consumers array now
  • number of consumers can be specified with concurrentConsumersAmount option
  • added messageProcessingTime and messageType to the log for better observability

processingResult: MessageProcessingResult,
messageId?: string,
) {
const messageTimestamp = message ? this.tryToExtractTimestamp(message) : undefined
Copy link
Owner

Choose a reason for hiding this comment

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

I would do the check on the log level for this.logger first and skip it entirely if it's below debug

Copy link
Collaborator Author

@kjamrog kjamrog Dec 11, 2024

Choose a reason for hiding this comment

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

From what I see Logger is a generic interface and it does not expose any property for log level. We could check level property as it's available in pino, but it won't apply all of the time

Copy link
Owner

@kibertoad kibertoad Dec 11, 2024

Choose a reason for hiding this comment

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

we should switch to CommonLogger interface from the node-core, it exposes the isLevelEnabled method from pino

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So we should probably change it everywhere and since logger is provided from outside that will be breaking change. Should I address it in separate PR then?

Copy link
Owner

Choose a reason for hiding this comment

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

yeah, makes sense

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Here is the draft PR with logger update: #233

I will add level condition there after this PR is merged

@kjamrog kjamrog requested a review from CarlosGamero December 11, 2024 13:50
README.md Outdated Show resolved Hide resolved
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.

3 participants