You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-docs/src/docs/asciidoc/messaging/pulsar.adoc
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,10 @@ This can be adjusted by setting the configprop:spring.pulsar.client.service-url[
20
20
21
21
TIP: The value must be a valid https://pulsar.apache.org/docs/client-libraries-java/#connection-urls[Pulsar Protocol] URL
22
22
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
+
23
27
[[messaging.pulsar.connecting.auth]]
24
28
==== Authentication
25
29
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
82
86
Spring Boot auto-configuration also provides this producer factory, which by default, caches the producers that it creates.
83
87
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.
84
88
89
+
If you need more control over the producer factory configuration, consider passing in a `ProducerBuilderCustomizer` when sending a message.
90
+
85
91
[[messaging.pulsar.sending-reactive]]
86
92
=== Sending a Message Reactively
87
93
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
92
98
Spring Boot auto-configuration also provides this sender factory, which by default, caches the producers that it creates.
93
99
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.
94
100
101
+
If you need more control over the sender factory configuration, consider passing in a `MessageSpecBuilderCustomizer` when sending a message.
95
102
96
103
[[messaging.pulsar.receiving]]
97
104
=== Receiving a Message
@@ -103,6 +110,8 @@ include::code:MyBean[]
103
110
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.
104
111
You can configure these components by specifying any of the `spring.pulsar.listener.\*` and `spring.pulsar.consumer.*` prefixed application properties.
105
112
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
+
106
115
[[messaging.pulsar.receiving-reactive]]
107
116
=== Receiving a Message Reactively
108
117
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[]
113
122
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.
114
123
You can configure these components by specifying any of the `spring.pulsar.reactive.listener.\*` and `spring.pulsar.reactiver.consumer.*` prefixed application properties.
115
124
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.
116
126
117
127
[[messaging.pulsar.reading]]
118
128
=== Reading a Message
@@ -127,6 +137,7 @@ include::code:MyBean[]
127
137
The `@PulsarReader` relies on a `PulsarReaderFactory` to create the underlying Pulsar reader.
128
138
Spring Boot auto-configuration provides this reader factory which can be customized by setting any of the `spring.pulsar.reader.*` prefixed application properties.
129
139
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.
130
141
131
142
[[messaging.pulsar.reading-reactive]]
132
143
=== Reading a Message Reactively
@@ -137,6 +148,16 @@ include::code:MyBean[]
137
148
138
149
Spring Boot auto-configuration provides this reader factory which can be customized by setting any of the `spring.pulsar.reactive.reader.*` prefixed application properties.
139
150
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.
140
152
141
153
142
154
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