-
Notifications
You must be signed in to change notification settings - Fork 20
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
Issue-327 Number of consumers should be configurable #399
Conversation
@@ -15,7 +15,7 @@ class ProductListener { | |||
|
|||
CopyOnWriteArraySet<String> threads = new CopyOnWriteArraySet<>() | |||
|
|||
@Queue(value = "product", numberOfConsumers = 5) // <1> | |||
@Queue(value = "product", numberOfConcurrentConsumers = "5") // <1> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the motivation for changing the member name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not 100% sure if that is the proper approach, but I added a new member(numberOfConcurrentConsumers
) and deprecated the old one(numberOfConsumers
) to avoid breaking the backward compatibility contract. The new member is of type String versus int to allow for config property placeholders.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps don't deprecate it for type safety a number is still handy. Name it numberOfConsumersValue
and this provides the option to use either. You can add @AliasFor("numberOfConsumers")
to the new member and then just read it "numberOfConsumers" here (you don't have to check for both) https://github.com/micronaut-projects/micronaut-rabbitmq/pull/399/files#diff-fce8edcc7a5dc02ecf4bf1520cf937dc82991c4fe4571bd3080118152de3c853R137
Assome, I wasn't aware of the @AliasFor option. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
No description provided.