-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
Add Pulsar config props for startup policy #42180
Conversation
This commit adds properties to configure the startup behavior for the Pulsar message containers that back the `@PulsarListener`, `@ReactivePulsarListener`, and `@PulsarReader`.
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.
Thanks for the PR. I've added some nit and I would have processed them myself but I'd like some confirmation about the default values and, potentially, a code change in Spring Pulsar to avoid code duplication.
Also, can you please build locally before pushing?
public static class Startup { | ||
|
||
/** | ||
* The max time to wait for the container to start. |
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.
Description of configuration properties do not start with the
, a
, etc. I suggest Time to wait for the container to start.
private Duration timeout; | ||
|
||
/** | ||
* The action to take when the container fails to start. |
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.
Same. I suggest Action to take when the container fails to start.
/** | ||
* The max time to wait for the container to start. | ||
*/ | ||
private Duration timeout; |
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.
Is there a default for this property? If so I think we should use the opportunity to set the default so that it's documented, and very in a test that it's consistent in case it changes.
/** | ||
* The action to take when the container fails to start. | ||
*/ | ||
private FailurePolicy onFailure; |
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 understand the previous behavior was to continue and log an exception. There's no default value here so it's hard to see if that's still the case. If that's the case, this field should have a default value that matches the default behavior.
customizeReaderStartupProperties(readerContainerProperties); | ||
} | ||
|
||
private void customizeReaderStartupProperties(PulsarReaderContainerProperties readerContainerProperties) { |
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.
It's unfortunate that this is the exact same code as customizeListenerStartupProperties
? Since the feature is shared, isn't there a way to avoid the code duplication?
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.
The code to de-duplicate was more complicated than having this in multiple places.
customizeListenerStartupProperties(containerProperties); | ||
} | ||
|
||
private void customizeListenerStartupProperties(ReactivePulsarContainerProperties<?> containerProperties) { |
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.
Here as well.
Yes, I saw the red builds. I was building locally (had already run tests w/in IDEA) but was not running checks as I was using This |
Closing in favor of #42182 |
This commit adds properties to configure the startup behavior for the Pulsar message containers that back the
@PulsarListener
,@ReactivePulsarListener
, and@PulsarReader
.This is to support the recently added startup policy feature in Spring for Apache Pulsar.