Skip to content

Commit 363497e

Browse files
committed
[PR requested change] [Docs] Config props reduction (~50% reduction)
1 parent ba8dfc4 commit 363497e

File tree

1 file changed

+21
-0
lines changed
  • spring-boot-project/spring-boot-docs/src/docs/asciidoc/messaging

1 file changed

+21
-0
lines changed

spring-boot-project/spring-boot-docs/src/docs/asciidoc/messaging/pulsar.adoc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ This can be adjusted by setting the configprop:spring.pulsar.client.service-url[
2020

2121
TIP: The value must be a valid https://pulsar.apache.org/docs/client-libraries-java/#connection-urls[Pulsar Protocol] URL
2222

23+
You can configure the client by specifying any of the `spring.pulsar.client.*` prefixed application properties.
24+
25+
If you need more control over the configuration, consider registering one or more `PulsarClientBuilderCustomizer` beans.
26+
2327
[[messaging.pulsar.connecting.auth]]
2428
==== Authentication
2529
To connect to a Pulsar cluster that requires authentication, you need to specify which authentication plugin to use by setting the `authPluginClassName` and any parameters required by the plugin.
@@ -82,6 +86,8 @@ The `PulsarTemplate` relies on a `PulsarProducerFactory` to create the underlyin
8286
Spring Boot auto-configuration also provides this producer factory, which by default, caches the producers that it creates.
8387
You can configure the producer factory and cache settings by specifying any of the `spring.pulsar.producer.\*` and `spring.pulsar.producer.cache.*` prefixed application properties.
8488

89+
If you need more control over the producer factory configuration, consider passing in a `ProducerBuilderCustomizer` when sending a message.
90+
8591
[[messaging.pulsar.sending-reactive]]
8692
=== Sending a Message Reactively
8793
When the Reactive auto-configuration is activated, Spring's `ReactivePulsarTemplate` is auto-configured, and you can use it to send messages, as shown in the following example:
@@ -92,6 +98,7 @@ The `ReactivePulsarTemplate` relies on a `ReactivePulsarSenderFactory` to actual
9298
Spring Boot auto-configuration also provides this sender factory, which by default, caches the producers that it creates.
9399
You can configure the sender factory and cache settings by specifying any of the `spring.pulsar.reactive.sender.\*` and `spring.pulsar.reactive.sender.cache.*` prefixed application properties.
94100

101+
If you need more control over the sender factory configuration, consider passing in a `MessageSpecBuilderCustomizer` when sending a message.
95102

96103
[[messaging.pulsar.receiving]]
97104
=== Receiving a Message
@@ -103,6 +110,8 @@ include::code:MyBean[]
103110
Spring Boot auto-configuration provides all the components necessary for `PulsarListener`, such as the `PulsarListenerContainerFactory` and the consumer factory it uses to construct the underlying Pulsar consumers.
104111
You can configure these components by specifying any of the `spring.pulsar.listener.\*` and `spring.pulsar.consumer.*` prefixed application properties.
105112

113+
If you need more control over the consumer factory configuration, consider registering a `ConsumerBuilderCustomizer` bean and specifying it on the `consumerCustomizer` attribute of the `@PulsarListener` annotation.
114+
106115
[[messaging.pulsar.receiving-reactive]]
107116
=== Receiving a Message Reactively
108117
When the Apache Pulsar infrastructure is present and the Reactive auto-configuration is activated, any bean can be annotated with `@ReactivePulsarListener` to create a reactive listener endpoint.
@@ -113,6 +122,7 @@ include::code:MyBean[]
113122
Spring Boot auto-configuration provides all the components necessary for `ReactivePulsarListener`, such as the `ReactivePulsarListenerContainerFactory` and the consumer factory it uses to construct the underlying reactive Pulsar consumers.
114123
You can configure these components by specifying any of the `spring.pulsar.reactive.listener.\*` and `spring.pulsar.reactiver.consumer.*` prefixed application properties.
115124

125+
If you need more control over the consumer factory configuration, consider registering a `ReactiveMessageConsumerBuilderCustomizer` bean and specifying it on the `consumerCustomizer` attribute of the `@ReactivePulsarListener` annotation.
116126

117127
[[messaging.pulsar.reading]]
118128
=== Reading a Message
@@ -127,6 +137,7 @@ include::code:MyBean[]
127137
The `@PulsarReader` relies on a `PulsarReaderFactory` to create the underlying Pulsar reader.
128138
Spring Boot auto-configuration provides this reader factory which can be customized by setting any of the `spring.pulsar.reader.*` prefixed application properties.
129139

140+
If you need more control over the reader factory configuration, consider registering a `ReaderBuilderCustomizer` bean and specifying it on the `readerCustomizer` attribute of the `@PulsarReader` annotation.
130141

131142
[[messaging.pulsar.reading-reactive]]
132143
=== Reading a Message Reactively
@@ -137,6 +148,16 @@ include::code:MyBean[]
137148

138149
Spring Boot auto-configuration provides this reader factory which can be customized by setting any of the `spring.pulsar.reactive.reader.*` prefixed application properties.
139150

151+
If you need more control over the reader factory configuration, consider passing in one or more `ReactiveMessageReaderBuilderCustomizer` instances when using the factory to create a reader.
140152

141153

142154
TIP: For more details on any of the above components and to discover other available features, see the Spring for Apache Pulsar {spring-pulsar-docs}[reference documentation].
155+
156+
[[messaging.pulsar.additional-properties]]
157+
=== Additional Pulsar Properties
158+
The properties supported by auto configuration are shown in the <<application-properties#appendix.application-properties.integration, "`Integration Properties`">> section of the Appendix.
159+
Note that, for the most part, these properties (hyphenated or camelCase) map directly to the Apache Pulsar configuration properties.
160+
See the Apache Pulsar documentation for details.
161+
162+
Only a subset of the properties supported by Pulsar are available directly through the `PulsarProperties` class.
163+
If you wish to tune the auto-configured components with additional properties that are not directly supported, you can use the customizer supported by each aforementioned component.

0 commit comments

Comments
 (0)