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
This removes the auto-configuration for Spring Pulsar Reactive.
Consolidates the PulsarConfiguration into the PulsarAutoConfiguration because
there is no longer a need to factor out the common components between Spring
Pulsar and Spring Pulsar Reactive.
See gh-47707
Signed-off-by: onobc <[email protected]>
Copy file name to clipboardExpand all lines: documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/messaging/pulsar.adoc
+2-69Lines changed: 2 additions & 69 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,11 +3,9 @@
3
3
4
4
https://pulsar.apache.org/[Apache Pulsar] is supported by providing auto-configuration of the {url-spring-pulsar-site}[Spring for Apache Pulsar] project.
5
5
6
-
Spring Boot will auto-configure and register the classic (imperative) Spring for Apache Pulsar components when `org.springframework.pulsar:spring-pulsar` is on the classpath.
7
-
It will do the same for the reactive components when `org.springframework.pulsar:spring-pulsar-reactive` is on the classpath.
8
-
9
-
There are `spring-boot-starter-pulsar` and `spring-boot-starter-pulsar-reactive` starters for conveniently collecting the dependencies for imperative and reactive use, respectively.
6
+
Spring Boot will auto-configure and register the Spring for Apache Pulsar components when `org.springframework.pulsar:spring-pulsar` is on the classpath.
10
7
8
+
There is the `spring-boot-starter-pulsar` starter for conveniently collecting the dependencies for use.
11
9
12
10
13
11
[[messaging.pulsar.connecting]]
@@ -68,15 +66,6 @@ You can follow {url-spring-pulsar-docs}/reference/pulsar/pulsar-client.html#tls-
68
66
69
67
For complete details on the client and authentication see the Spring for Apache Pulsar {url-spring-pulsar-docs}/reference/pulsar/pulsar-client.html[reference documentation].
70
68
71
-
[[messaging.pulsar.connecting-reactive]]
72
-
== Connecting to Pulsar Reactively
73
-
74
-
When the Reactive auto-configuration is activated, Spring Boot will auto-configure and register a javadoc:org.apache.pulsar.reactive.client.api.ReactivePulsarClient[] bean.
75
-
76
-
The javadoc:org.apache.pulsar.reactive.client.api.ReactivePulsarClient[] adapts an instance of the previously described javadoc:org.apache.pulsar.client.api.PulsarClient[].
77
-
Therefore, follow the previous section to configure the javadoc:org.apache.pulsar.client.api.PulsarClient[] used by the javadoc:org.apache.pulsar.reactive.client.api.ReactivePulsarClient[].
78
-
79
-
80
69
81
70
[[messaging.pulsar.admin]]
82
71
== Connecting to Pulsar Administration
@@ -118,27 +107,6 @@ You can also pass in a javadoc:org.springframework.pulsar.core.ProducerBuilderCu
118
107
119
108
If you need more control over the message being sent, you can pass in a javadoc:org.springframework.pulsar.core.TypedMessageBuilderCustomizer[] when sending a message.
120
109
121
-
122
-
123
-
[[messaging.pulsar.sending-reactive]]
124
-
== Sending a Message Reactively
125
-
126
-
When the Reactive auto-configuration is activated, Spring's javadoc:org.springframework.pulsar.reactive.core.ReactivePulsarTemplate[] is auto-configured, and you can use it to send messages, as shown in the following example:
127
-
128
-
include-code::MyBean[]
129
-
130
-
The javadoc:org.springframework.pulsar.reactive.core.ReactivePulsarTemplate[] relies on a javadoc:org.springframework.pulsar.reactive.core.ReactivePulsarSenderFactory[] to actually create the underlying sender.
131
-
Spring Boot auto-configuration also provides this sender factory, which by default, caches the producers that it creates.
132
-
You can configure the sender factory and cache settings by specifying any of the `spring.pulsar.producer.\*` and `spring.pulsar.producer.cache.*` prefixed application properties.
133
-
134
-
If you need more control over the sender factory configuration, consider registering one or more javadoc:org.springframework.pulsar.reactive.core.ReactiveMessageSenderBuilderCustomizer[] beans.
135
-
These customizers are applied to all created senders.
136
-
You can also pass in a javadoc:org.springframework.pulsar.reactive.core.ReactiveMessageSenderBuilderCustomizer[] when sending a message to only affect the current sender.
137
-
138
-
If you need more control over the message being sent, you can pass in a javadoc:org.springframework.pulsar.reactive.core.MessageSpecBuilderCustomizer[] when sending a message.
139
-
140
-
141
-
142
110
[[messaging.pulsar.receiving]]
143
111
== Receiving a Message
144
112
@@ -156,23 +124,6 @@ You can also customize a single listener by setting the `consumerCustomizer` att
156
124
157
125
If you need more control over the actual container factory configuration, consider registering one or more `PulsarContainerFactoryCustomizer<ConcurrentPulsarListenerContainerFactory<?>>` beans.
158
126
159
-
[[messaging.pulsar.receiving-reactive]]
160
-
== Receiving a Message Reactively
161
-
162
-
When the Apache Pulsar infrastructure is present and the Reactive auto-configuration is activated, any bean can be annotated with javadoc:org.springframework.pulsar.reactive.config.annotation.ReactivePulsarListener[format=annotation] to create a reactive listener endpoint.
163
-
The following component creates a reactive listener endpoint on the `someTopic` topic:
164
-
165
-
include-code::MyBean[]
166
-
167
-
Spring Boot auto-configuration provides all the components necessary for javadoc:org.springframework.pulsar.reactive.config.annotation.ReactivePulsarListener[], such as the javadoc:org.springframework.pulsar.reactive.config.ReactivePulsarListenerContainerFactory[] and the consumer factory it uses to construct the underlying reactive Pulsar consumers.
168
-
You can configure these components by specifying any of the `spring.pulsar.listener.\*` and `spring.pulsar.consumer.*` prefixed application properties.
169
-
170
-
If you need more control over the configuration of the consumer factory, consider registering one or more javadoc:org.springframework.pulsar.reactive.core.ReactiveMessageConsumerBuilderCustomizer[] beans.
171
-
These customizers are applied to all consumers created by the factory, and therefore all javadoc:org.springframework.pulsar.reactive.config.annotation.ReactivePulsarListener[format=annotation] instances.
172
-
You can also customize a single listener by setting the `consumerCustomizer` attribute of the javadoc:org.springframework.pulsar.reactive.config.annotation.ReactivePulsarListener[format=annotation] annotation.
173
-
174
-
If you need more control over the actual container factory configuration, consider registering one or more `PulsarContainerFactoryCustomizer<DefaultReactivePulsarListenerContainerFactory<?>>` beans.
175
-
176
127
[[messaging.pulsar.reading]]
177
128
== Reading a Message
178
129
@@ -194,22 +145,6 @@ You can also customize a single listener by setting the `readerCustomizer` attri
194
145
If you need more control over the actual container factory configuration, consider registering one or more `PulsarContainerFactoryCustomizer<DefaultPulsarReaderContainerFactory<?>>` beans.
195
146
196
147
197
-
[[messaging.pulsar.reading-reactive]]
198
-
== Reading a Message Reactively
199
-
200
-
When the Apache Pulsar infrastructure is present and the Reactive auto-configuration is activated, Spring's javadoc:org.springframework.pulsar.reactive.core.ReactivePulsarReaderFactory[] is provided, and you can use it to create a reader in order to read messages in a reactive fashion.
201
-
The following component creates a reader using the provided factory and reads a single message from 5 minutes ago from the `someTopic` topic:
202
-
203
-
include-code::MyBean[]
204
-
205
-
Spring Boot auto-configuration provides this reader factory which can be customized by setting any of the `spring.pulsar.reader.*` prefixed application properties.
206
-
207
-
If you need more control over the reader factory configuration, consider passing in one or more javadoc:org.springframework.pulsar.reactive.core.ReactiveMessageReaderBuilderCustomizer[] instances when using the factory to create a reader.
208
-
209
-
If you need more control over the reader factory configuration, consider registering one or more javadoc:org.springframework.pulsar.reactive.core.ReactiveMessageReaderBuilderCustomizer[] beans.
210
-
These customizers are applied to all created readers.
211
-
You can also pass one or more javadoc:org.springframework.pulsar.reactive.core.ReactiveMessageReaderBuilderCustomizer[] when creating a reader to only apply the customizations to the created reader.
212
-
213
148
TIP: For more details on any of the above components and to discover other available features, see the Spring for Apache Pulsar {url-spring-pulsar-docs}[reference documentation].
214
149
215
150
@@ -219,8 +154,6 @@ TIP: For more details on any of the above components and to discover other avail
219
154
220
155
Spring for Apache Pulsar supports transactions when using javadoc:org.springframework.pulsar.core.PulsarTemplate[] and javadoc:org.springframework.pulsar.annotation.PulsarListener[format=annotation].
221
156
222
-
NOTE: Transactions are not currently supported when using the reactive variants.
223
-
224
157
Setting the configprop:spring.pulsar.transaction.enabled[] property to `true` will:
225
158
226
159
* Configure a javadoc:org.springframework.pulsar.transaction.PulsarTransactionManager[] bean
Copy file name to clipboardExpand all lines: documentation/spring-boot-docs/src/main/java/org/springframework/boot/docs/messaging/pulsar/readingreactive/MyBean.java
Copy file name to clipboardExpand all lines: documentation/spring-boot-docs/src/main/java/org/springframework/boot/docs/messaging/pulsar/receivingreactive/MyBean.java
Copy file name to clipboardExpand all lines: documentation/spring-boot-docs/src/main/java/org/springframework/boot/docs/messaging/pulsar/sendingreactive/MyBean.java
Copy file name to clipboardExpand all lines: documentation/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/messaging/pulsar/readingreactive/MyBean.kt
0 commit comments