Skip to content

Commit 4981b28

Browse files
authored
Update to Pulsar 3.3.1 (#772)
* Update to Pulsar 3.3.1 * Handles deprecation to PulsarClient.getPartitionsForTopic(String) * Adds support to PulsarClientProxy for newly added PulsarClient.getPartitionsForTopic(String, boolean) * Add deprecation note to "What's New" doc Resolves #767
1 parent db77d87 commit 4981b28

File tree

11 files changed

+34
-9
lines changed

11 files changed

+34
-9
lines changed

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ micrometer = "1.13.2"
99
micrometer-docs-gen = "1.0.3"
1010
micrometer-tracing = "1.3.2"
1111
protobuf = "3.25.4"
12-
pulsar = "3.3.0"
12+
pulsar = "3.3.1"
1313
pulsar-reactive = "0.5.6"
1414
reactor = "2023.0.8"
1515
spring = "6.1.11"

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ This section covers the changes made from version 1.1 to version 1.2.
1010
You can provide your own Jackson `ObjectMapper` that Pulsar will use when producing and consuming JSON messages.
1111
See xref:./reference/custom-object-mapper.adoc[Custom Object Mapper] for more details.
1212

13+
=== Deprecations
14+
15+
==== PulsarClient#getPartitionsForTopic(java.lang.String)
16+
Version `3.3.1` of the Pulsar client deprecates the `getPartitionsForTopic(java.lang.String)` in favor of `getPartitionsForTopic(java.lang.String, boolean metadataAutoCreationEnabled)`.
17+
1318
[[what-s-new-in-1-1-since-1-0]]
1419
== What's New in 1.1 Since 1.0
1520
:page-section-summary-toc: 1

spring-pulsar-sample-apps/sample-failover-custom-router/compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
pulsar:
3-
image: 'apachepulsar/pulsar:3.3.0'
3+
image: 'apachepulsar/pulsar:3.3.1'
44
ports:
55
- '6650'
66
- '8080'

spring-pulsar-sample-apps/sample-imperative-produce-consume/compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
pulsar:
3-
image: 'apachepulsar/pulsar:3.3.0'
3+
image: 'apachepulsar/pulsar:3.3.1'
44
ports:
55
- '6650'
66
- '8080'

spring-pulsar-sample-apps/sample-pulsar-binder/compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
pulsar:
3-
image: 'apachepulsar/pulsar:3.3.0'
3+
image: 'apachepulsar/pulsar:3.3.1'
44
ports:
55
- '6650'
66
- '8080'

spring-pulsar-sample-apps/sample-pulsar-functions/download-connectors.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
mkdir connectors
44
cd connectors
5-
wget https://archive.apache.org/dist/pulsar/pulsar-3.3.0/connectors/pulsar-io-cassandra-3.3.0.nar
6-
wget https://archive.apache.org/dist/pulsar/pulsar-3.3.0/connectors/pulsar-io-rabbitmq-3.3.0.nar
5+
wget https://archive.apache.org/dist/pulsar/pulsar-3.3.1/connectors/pulsar-io-cassandra-3.3.1.nar
6+
wget https://archive.apache.org/dist/pulsar/pulsar-3.3.1/connectors/pulsar-io-rabbitmq-3.3.1.nar
77
cd ..

spring-pulsar-sample-apps/sample-pulsar-reader/compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
pulsar:
3-
image: 'apachepulsar/pulsar:3.3.0'
3+
image: 'apachepulsar/pulsar:3.3.1'
44
ports:
55
- '6650'
66
- '8080'

spring-pulsar-sample-apps/sample-reactive/compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
pulsar:
3-
image: 'apachepulsar/pulsar:3.3.0'
3+
image: 'apachepulsar/pulsar:3.3.1'
44
ports:
55
- '6650'
66
- '8080'

spring-pulsar/src/main/java/org/springframework/pulsar/core/PulsarClientProxy.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,24 @@ public void updateServiceUrl(String serviceUrl) throws PulsarClientException {
170170
this.getInstance().updateServiceUrl(serviceUrl);
171171
}
172172

173+
/**
174+
* Get the list of partitions for a given topic.
175+
* @param topic the topic name
176+
* @return a future that will yield a list of the topic partitions
177+
* @deprecated in favor of {@link #getPartitionsForTopic(String, boolean)}
178+
* @see PulsarClient#getPartitionsForTopic(String)
179+
*/
173180
@Override
181+
@Deprecated(since = "1.2.0", forRemoval = true)
174182
public CompletableFuture<List<String>> getPartitionsForTopic(String topic) {
175183
return this.getInstance().getPartitionsForTopic(topic);
176184
}
177185

186+
@Override
187+
public CompletableFuture<List<String>> getPartitionsForTopic(String topic, boolean metadataAutoCreationEnabled) {
188+
return this.getInstance().getPartitionsForTopic(topic, metadataAutoCreationEnabled);
189+
}
190+
178191
@Override
179192
public void close() throws PulsarClientException {
180193
this.getInstance().close();

spring-pulsar/src/test/java/org/springframework/pulsar/core/PulsarClientProxyTests.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,13 @@ void updateServiceUrl() throws PulsarClientException {
165165

166166
@Test
167167
void getPartitionsForTopic() {
168+
this.restartableClient.getPartitionsForTopic("zTopic", true);
169+
verify(this.delegateClient).getPartitionsForTopic("zTopic", true);
170+
}
171+
172+
@Test
173+
@SuppressWarnings({ "deprecation", "removal" })
174+
void getPartitionsForTopicDeprecated() {
168175
this.restartableClient.getPartitionsForTopic("zTopic");
169176
verify(this.delegateClient).getPartitionsForTopic("zTopic");
170177
}

0 commit comments

Comments
 (0)