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

Add docs for container startup failure policy #841

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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 spring-pulsar-docs/src/main/antora/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ asciidoc:
attributes:
listener-class: PulsarListener@
template-class: PulsarTemplate@
container-class: ConcurrentPulsarListenerContainerFactory@
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@ each attempt.
However, a custom retry template can be specified on the corresponding container properties.
If the container fails to restart after the retries are exhausted, it is left in a non-running state.

[discrete]
== Configuration

[discrete]
=== With Spring Boot
**TODO**
When using Spring Boot you can register a `PulsarContainerFactoryCustomizer<{container-class}<?>>` bean that sets the container startup properties.

[discrete]
=== Without Spring Boot
**TODO**
However, if you are instead manually configuring the components, you will have to update the container startup properties accordingly when constructing the message listener container factory.
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,7 @@ void someMethod() {
TIP: The id parameter passed to `getListenerContainer` is the container id - which will be the value of the `@PulsarListener` id attribute when pausing/resuming a `@PulsarListener`.

[[message-listener-startup-failure]]
:container-class: ConcurrentPulsarListenerContainerFactory
include::../message-listener-startup-failure.adoc[leveloffset=+2]


Expand Down Expand Up @@ -1031,5 +1032,6 @@ public PulsarReaderReaderBuilderCustomizer<String> myCustomizer() {

TIP: If your application only has a single `@PulsarReader` and a single `PulsarReaderReaderBuilderCustomizer` bean registered then the customizer will be automatically applied.

=== Handling Startup Failures
The same xref:#message-listener-startup-failure[startup failure facilities] available to message listener containers are available for reader containers.
[[message-reader-startup-failure]]
:container-class: DefaultPulsarReaderContainerFactory
include::../message-listener-startup-failure.adoc[leveloffset=+2]
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ The "listener" aspect is provided by the `ReactivePulsarMessageHandler` of which
NOTE: If topic information is not specified when using the listener containers directly, the same xref:reference/topic-resolution.adoc#topic-resolution-process[topic resolution process] used by the `ReactivePulsarListener` is used with the one exception that the "Message type default" step is **omitted**.

[[message-listener-startup-failure]]
:container-class: DefaultReactivePulsarListenerContainerFactory
include::../message-listener-startup-failure.adoc[leveloffset=+2]

[[reactive-concurrency]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ See xref:./reference/custom-object-mapper.adoc[Custom Object Mapper] for more de
You can specify a default tenant and/or namespace to use when producing or consuming messages against a non-fully-qualified topic URL.
See xref:./reference/default-tenant-namespace.adoc[Default Tenant / Namespace] for more details.

=== Message Container Startup Policy
You can now configure the message listener container startup failure policy to `stop`, `continue`, or `retry`.
For more details see the corresponding section for one of the supported containers xref:./reference/pulsar/message-consumption.adoc#message-listener-startup-failure[@PulsarListener], xref:./reference/pulsar/message-consumption.adoc#message-reader-startup-failure[@PulsarReader], or xref:./reference/reactive-pulsar/reactive-message-consumption.adoc#message-listener-startup-failure[@ReactivePulsarListener]



=== Deprecations

==== PulsarClient#getPartitionsForTopic(java.lang.String)
Expand Down