Skip to content

Commit 8ed6689

Browse files
authored
Add docs for container startup failure policy (#841)
1 parent 82e3e7a commit 8ed6689

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

spring-pulsar-docs/src/main/antora/antora.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ asciidoc:
1414
attributes:
1515
listener-class: PulsarListener@
1616
template-class: PulsarTemplate@
17+
container-class: ConcurrentPulsarListenerContainerFactory@

spring-pulsar-docs/src/main/antora/modules/ROOT/pages/reference/message-listener-startup-failure.adoc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@ each attempt.
1616
However, a custom retry template can be specified on the corresponding container properties.
1717
If the container fails to restart after the retries are exhausted, it is left in a non-running state.
1818

19-
[discrete]
2019
== Configuration
2120

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

2625
[discrete]
2726
=== Without Spring Boot
28-
**TODO**
27+
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.

spring-pulsar-docs/src/main/antora/modules/ROOT/pages/reference/pulsar/message-consumption.adoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -977,6 +977,7 @@ void someMethod() {
977977
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`.
978978

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

982983

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

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

1034-
=== Handling Startup Failures
1035-
The same xref:#message-listener-startup-failure[startup failure facilities] available to message listener containers are available for reader containers.
1035+
[[message-reader-startup-failure]]
1036+
:container-class: DefaultPulsarReaderContainerFactory
1037+
include::../message-listener-startup-failure.adoc[leveloffset=+2]

spring-pulsar-docs/src/main/antora/modules/ROOT/pages/reference/reactive-pulsar/reactive-message-consumption.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ The "listener" aspect is provided by the `ReactivePulsarMessageHandler` of which
207207
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**.
208208

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

212213
[[reactive-concurrency]]

spring-pulsar-docs/src/main/antora/modules/ROOT/pages/whats-new.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ See xref:./reference/custom-object-mapper.adoc[Custom Object Mapper] for more de
1414
You can specify a default tenant and/or namespace to use when producing or consuming messages against a non-fully-qualified topic URL.
1515
See xref:./reference/default-tenant-namespace.adoc[Default Tenant / Namespace] for more details.
1616

17+
=== Message Container Startup Policy
18+
You can now configure the message listener container startup failure policy to `stop`, `continue`, or `retry`.
19+
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]
20+
21+
22+
1723
=== Deprecations
1824

1925
==== PulsarClient#getPartitionsForTopic(java.lang.String)

0 commit comments

Comments
 (0)