Skip to content

Commit a48eaf2

Browse files
authored
Use Spring Boot Pulsar starters (#441)
Fixes #439
1 parent 7256ecf commit a48eaf2

File tree

18 files changed

+57
-51
lines changed

18 files changed

+57
-51
lines changed

gradle.properties

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ pulsarClientReactiveVersion=0.3.0
1010
# only used by docs, tests, and samples (unpublished deps)
1111
springBootVersion=3.2.0-SNAPSHOT
1212

13-
springFrameworkVersion=6.1.0-M3
13+
springFrameworkVersion=6.1.0-M4
1414

1515
# these are temp until autoconfig moves into boot
16-
springPulsarStarterVersion=0.2.1-SNAPSHOT
1716
springPulsarBinderVersion=0.2.1-SNAPSHOT
1817
springCloudStreamVersion=4.0.3

integration-tests/integration-tests.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ dependencies {
1616
intTestImplementation project(':spring-pulsar-test')
1717
intTestRuntimeOnly 'ch.qos.logback:logback-classic'
1818
intTestRuntimeOnly 'org.junit.platform:junit-platform-launcher'
19-
intTestImplementation "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
20-
intTestImplementation "org.springframework.boot:spring-boot-starter-amqp:$springBootVersion"
21-
intTestImplementation "org.springframework.pulsar:spring-pulsar-spring-boot-starter:$springPulsarStarterVersion"
22-
intTestImplementation "org.springframework.pulsar:spring-pulsar-reactive-spring-boot-starter:$springPulsarStarterVersion"
19+
intTestImplementation "org.springframework.boot:spring-boot-starter-test:${springBootVersion}"
20+
intTestImplementation "org.springframework.boot:spring-boot-starter-amqp:${springBootVersion}"
21+
intTestImplementation "org.springframework.boot:spring-boot-starter-pulsar:${springBootVersion}"
22+
intTestImplementation "org.springframework.boot:spring-boot-starter-pulsar-reactive:${springBootVersion}"
2323
intTestImplementation 'org.testcontainers:junit-jupiter'
2424
intTestImplementation 'org.testcontainers:pulsar'
2525
intTestImplementation 'org.testcontainers:rabbitmq'
@@ -41,8 +41,8 @@ task downloadRabbitConnector {
4141
try {
4242
download.run {
4343
println "Downloading Rabbit connector to 'src/intTest/resources/connectors/' (one time only if not already downloaded)..."
44-
src 'https://archive.apache.org/dist/pulsar/pulsar-2.10.2/connectors/pulsar-io-rabbitmq-2.10.2.nar'
45-
dest "$buildDir/../src/intTest/resources/connectors/pulsar-io-rabbitmq-2.10.2.nar"
44+
src 'https://archive.apache.org/dist/pulsar/pulsar-3.1.0/connectors/pulsar-io-rabbitmq-3.1.0.nar'
45+
dest "$buildDir/../src/intTest/resources/connectors/pulsar-io-rabbitmq-3.1.0.nar"
4646
overwrite false
4747
}
4848
} catch (Exception ex) {

integration-tests/src/intTest/java/org/springframework/pulsar/autoconfigure/PulsarFunctionAdministrationIntegrationTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
import org.springframework.boot.SpringApplication;
5454
import org.springframework.boot.WebApplicationType;
5555
import org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration;
56+
import org.springframework.boot.autoconfigure.pulsar.PulsarAutoConfiguration;
5657
import org.springframework.context.ConfigurableApplicationContext;
5758
import org.springframework.context.annotation.Bean;
5859
import org.springframework.context.annotation.Configuration;
@@ -123,7 +124,7 @@ void verifyRabbitSourceIsCreatedAndMessagesAreSourcedIntoPulsar() throws Excepti
123124
app.setWebApplicationType(WebApplicationType.NONE);
124125
try (ConfigurableApplicationContext context = app.run(
125126
"--spring.pulsar.client.service-url=" + PULSAR_CONTAINER.getPulsarBrokerUrl(),
126-
"--spring.pulsar.administration.service-url=" + PULSAR_CONTAINER.getHttpServiceUrl(),
127+
"--spring.pulsar.admin.service-url=" + PULSAR_CONTAINER.getHttpServiceUrl(),
127128
"--spring.rabbitmq.host=" + RABBITMQ_CONTAINER.getHost(),
128129
"--spring.rabbitmq.port=" + RABBITMQ_CONTAINER.getAmqpPort())) {
129130

@@ -148,7 +149,7 @@ void verifyStopPolicyIsEnforcedOnShutdown() throws Exception {
148149
app.setWebApplicationType(WebApplicationType.NONE);
149150
try (ConfigurableApplicationContext ignored = app.run(
150151
"--spring.pulsar.client.service-url=" + PULSAR_CONTAINER.getPulsarBrokerUrl(),
151-
"--spring.pulsar.administration.service-url=" + PULSAR_CONTAINER.getHttpServiceUrl(),
152+
"--spring.pulsar.admin.service-url=" + PULSAR_CONTAINER.getHttpServiceUrl(),
152153
"--spring.rabbitmq.host=" + RABBITMQ_CONTAINER.getHost(),
153154
"--spring.rabbitmq.port=" + RABBITMQ_CONTAINER.getAmqpPort())) {
154155

spring-pulsar-dependencies/spring-pulsar-dependencies.gradle

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ javaPlatform {
88

99
dependencies {
1010
api platform("com.fasterxml.jackson:jackson-bom:2.15.2")
11-
api platform("io.micrometer:micrometer-bom:1.12.0-M1")
12-
api platform("io.micrometer:micrometer-tracing-bom:1.2.0-M1")
13-
api platform("io.projectreactor:reactor-bom:2023.0.0-M1")
11+
api platform("io.micrometer:micrometer-bom:1.12.0-M2")
12+
api platform("io.micrometer:micrometer-tracing-bom:1.2.0-M2")
13+
api platform("io.projectreactor:reactor-bom:2023.0.0-M2")
1414
api platform("io.zipkin.brave:brave-bom:5.16.0")
1515
api platform("org.assertj:assertj-bom:3.24.2")
1616
api platform("org.awaitility:awaitility:4.2.0")
17-
api platform("org.junit:junit-bom:5.9.3")
18-
api platform("org.mockito:mockito-bom:5.4.0")
17+
api platform("org.junit:junit-bom:5.10.0")
18+
api platform("org.mockito:mockito-bom:5.5.0")
1919
api platform("org.springframework:spring-framework-bom:$springFrameworkVersion")
20-
api platform("org.testcontainers:testcontainers-bom:1.18.3")
20+
api platform("org.testcontainers:testcontainers-bom:1.19.0")
2121

2222
constraints {
23-
api "ch.qos.logback:logback-classic:1.4.8"
24-
api "com.github.ben-manes.caffeine:caffeine:3.1.6"
23+
api "ch.qos.logback:logback-classic:1.4.11"
24+
api "com.github.ben-manes.caffeine:caffeine:3.1.8"
2525
api "com.google.code.findbugs:jsr305:3.0.2"
2626
api "com.google.protobuf:protobuf-java:3.21.5"
2727
api "com.jayway.jsonpath:json-path:2.8.0"

spring-pulsar-docs/spring-pulsar-docs.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ tasks.withType(org.asciidoctor.gradle.jvm.AbstractAsciidoctorTask) {
9090
"spring-cloud-stream-version": project.springCloudStreamVersion ?: 'current',
9191
"spring-pulsar-version": project.version,
9292
"spring-pulsar-binder-version": project.springPulsarBinderVersion ?: 'current',
93-
"spring-pulsar-starter-version": project.springPulsarStarterVersion ?: 'current',
9493
"pulsar-client-version": project.pulsarClientVersion ?: 'current',
9594
"pulsar-client-reactive-version": project.pulsarClientReactiveVersion ?: 'current',
9695
"is-snapshot-version": project.version.endsWith("-SNAPSHOT")

spring-pulsar-docs/src/main/asciidoc/attributes-variables.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
:spring-cloud-stream-version: current
44
:spring-pulsar-version: current
55
:spring-pulsar-binder-version: current
6-
:spring-pulsar-starter-version: current
76
:pulsar-client-version: current
87
:pulsar-client-reactive-version: current
98
:is-snapshot-version: false

spring-pulsar-docs/src/main/asciidoc/pulsar-admin.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ The administration implements an interface called `PulsarAdminOperations` and pr
1010
When you use the Pulsar Spring Boot starter, you get the `PulsarAdministration` auto-configured.
1111

1212
By default, the application tries to connect to a local Pulsar instance at `\http://localhost:8080`.
13-
This can be adjusted by setting the `spring.pulsar.administration.service-url` property to a different value in the form `(http|https)://<host>:<port>`.
13+
This can be adjusted by setting the `spring.pulsar.admin.service-url` property to a different value in the form `(http|https)://<host>:<port>`.
1414

1515
There are many application properties available to configure the client.
16-
See the {spring-boot-pulsar-config-props}[`spring.pulsar.administration.*`] application properties.
16+
See the {spring-boot-pulsar-config-props}[`spring.pulsar.admin.*`] application properties.
1717

1818
[[pulsar-admin-authentication]]
1919
=== Authentication
2020
When accessing a Pulsar cluster that requires authentication, the admin client requires the same security configuration as the regular Pulsar client.
21-
You can use the aforementioned <<pulsar.adoc#client-authentication,security configuration>> by replacing `spring.pulsar.client` with `spring.pulsar.administration`.
21+
You can use the aforementioned <<pulsar.adoc#client-authentication,security configuration>> by replacing `spring.pulsar.client` with `spring.pulsar.admin`.
2222

2323
[[pulsar-auto-topic-creation]]
2424
== Automatic Topic Creation

spring-pulsar-docs/src/main/asciidoc/pulsar-binder.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ Spring Cloud Stream binder for Apache Pulsar comes with an out-of-the-box provis
250250
When running an application, if the necessary topics are absent, Pulsar will create the topics for you.
251251
However, this is a basic non-partitioned topic, and if you want advanced features like creating a partitioned topic, you can rely on the topic provisioner in the binder.
252252
Pulsar topic provisioner uses `PulsarAdministration` from the framework, which uses the `PulsarAdminBuilder.`
253-
For this reason, you need to set the `spring.pulsar.administration.service-url` property unless you are running Pulsar on the default server and port.
253+
For this reason, you need to set the `spring.pulsar.admin.service-url` property unless you are running Pulsar on the default server and port.
254254

255255
=== Specifying partition count when creating the topic
256256

spring-pulsar-docs/src/main/asciidoc/quick-tour.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Spring Boot applications need only the `spring-pulsar-spring-boot-starter` depen
1313
----
1414
<dependencies>
1515
<dependency>
16-
<groupId>org.springframework.pulsar</groupId>
17-
<artifactId>spring-pulsar-spring-boot-starter</artifactId>
18-
<version>{spring-pulsar-starter-version}</version>
16+
<groupId>org.springframework.boot</groupId>
17+
<artifactId>spring-boot-starter-pulsar</artifactId>
18+
<version>{spring-boot-version}</version>
1919
</dependency>
2020
</dependencies>
2121
----
@@ -24,7 +24,7 @@ Spring Boot applications need only the `spring-pulsar-spring-boot-starter` depen
2424
.Gradle
2525
----
2626
dependencies {
27-
implementation 'org.springframework.pulsar:spring-pulsar-spring-boot-starter:{spring-pulsar-starter-version}'
27+
implementation 'org.springframework.boot:spring-boot-starter-pulsar:{spring-boot-version}'
2828
}
2929
----
3030

spring-pulsar-docs/src/main/asciidoc/reactive-quick-tour.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ Spring Boot applications need only the `spring-pulsar-reactive-spring-boot-start
1414
----
1515
<dependencies>
1616
<dependency>
17-
<groupId>org.springframework.pulsar</groupId>
18-
<artifactId>spring-pulsar-reactive-spring-boot-starter</artifactId>
19-
<version>{spring-pulsar-starter-version}</version>
17+
<groupId>org.springframework.boot</groupId>
18+
<artifactId>spring-boot-starter-pulsar-reactive</artifactId>
19+
<version>{spring-boot-version}</version>
2020
</dependency>
2121
</dependencies>
2222
----
2323
[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"]
2424
.Gradle
2525
----
2626
dependencies {
27-
implementation 'org.springframework.pulsar:spring-pulsar-reactive-spring-boot-starter:{spring-pulsar-starter-version}'
27+
implementation 'org.springframework.boot:spring-boot-starter-pulsar-reactive:{spring-boot-version}'
2828
}
2929
----
3030

0 commit comments

Comments
 (0)