Create spring-boot-pulsar module

This commit is contained in:
Andy Wilkinson 2025-03-20 17:38:21 +00:00
parent c9f70881ea
commit dc29db93ad
41 changed files with 125 additions and 95 deletions

View File

@ -64,6 +64,7 @@ include "spring-boot-project:spring-boot-kafka"
include "spring-boot-project:spring-boot-liquibase"
include "spring-boot-project:spring-boot-mail"
include "spring-boot-project:spring-boot-parent"
include "spring-boot-project:spring-boot-pulsar"
include "spring-boot-project:spring-boot-reactor-netty"
include "spring-boot-project:spring-boot-test"
include "spring-boot-project:spring-boot-test-autoconfigure"

View File

@ -39,7 +39,6 @@ dependencies {
dockerTestImplementation("org.testcontainers:junit-jupiter")
dockerTestImplementation("org.testcontainers:mongodb")
dockerTestImplementation("org.testcontainers:neo4j")
dockerTestImplementation("org.testcontainers:pulsar")
dockerTestImplementation("org.testcontainers:testcontainers")
optional(project(":spring-boot-project:spring-boot-activemq"))
@ -191,8 +190,6 @@ dependencies {
optional("org.springframework.data:spring-data-redis")
optional("org.springframework.graphql:spring-graphql")
optional("org.springframework.hateoas:spring-hateoas")
optional("org.springframework.pulsar:spring-pulsar")
optional("org.springframework.pulsar:spring-pulsar-reactive")
optional("org.springframework.security:spring-security-acl")
optional("org.springframework.security:spring-security-config")
optional("org.springframework.security:spring-security-data")
@ -255,7 +252,6 @@ dependencies {
testImplementation("org.postgresql:postgresql")
testImplementation("org.postgresql:r2dbc-postgresql")
testImplementation("org.springframework.graphql:spring-graphql-test")
testImplementation("org.springframework.pulsar:spring-pulsar-cache-provider-caffeine")
testImplementation("org.springframework.security:spring-security-test")
testImplementation("org.yaml:snakeyaml")

View File

@ -1021,24 +1021,6 @@
"name": "spring.neo4j.uri",
"defaultValue": "bolt://localhost:7687"
},
{
"name": "spring.pulsar.defaults.topic.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable default tenant and namespace support for topics.",
"defaultValue": true
},
{
"name": "spring.pulsar.function.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable function support.",
"defaultValue": true
},
{
"name": "spring.pulsar.producer.cache.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable caching in the PulsarProducerFactory.",
"defaultValue": true
},
{
"name": "spring.quartz.jdbc.comment-prefix",
"defaultValue": [

View File

@ -64,8 +64,6 @@ org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration
org.springframework.boot.autoconfigure.neo4j.Neo4jAutoConfiguration
org.springframework.boot.autoconfigure.netty.NettyAutoConfiguration
org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
org.springframework.boot.autoconfigure.pulsar.PulsarAutoConfiguration
org.springframework.boot.autoconfigure.pulsar.PulsarReactiveAutoConfiguration
org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration
org.springframework.boot.autoconfigure.r2dbc.R2dbcAutoConfiguration
org.springframework.boot.autoconfigure.r2dbc.R2dbcInitializationAutoConfiguration

View File

@ -2041,6 +2041,7 @@ bom {
"spring-boot-loader-tools",
"spring-boot-mail",
"spring-boot-properties-migrator",
"spring-boot-pulsar",
"spring-boot-reactor-netty",
"spring-boot-starter",
"spring-boot-starter-activemq",

View File

@ -14,6 +14,7 @@ dependencies {
dockerTestImplementation(project(":spring-boot-project:spring-boot-jdbc"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-flyway"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-liquibase"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-pulsar"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
dockerTestImplementation("com.hazelcast:hazelcast")
dockerTestImplementation("com.redis:testcontainers-redis")
@ -42,6 +43,7 @@ dependencies {
optional(project(":spring-boot-project:spring-boot-flyway"))
optional(project(":spring-boot-project:spring-boot-jdbc"))
optional(project(":spring-boot-project:spring-boot-liquibase"))
optional(project(":spring-boot-project:spring-boot-pulsar"))
optional("com.hazelcast:hazelcast")
optional("io.r2dbc:r2dbc-spi")
optional("org.mongodb:mongodb-driver-core")

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -16,8 +16,8 @@
package org.springframework.boot.docker.compose.service.connection.pulsar;
import org.springframework.boot.autoconfigure.pulsar.PulsarConnectionDetails;
import org.springframework.boot.docker.compose.service.connection.test.DockerComposeTest;
import org.springframework.boot.pulsar.autoconfigure.PulsarConnectionDetails;
import org.springframework.boot.testsupport.container.TestImage;
import static org.assertj.core.api.Assertions.assertThat;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -16,11 +16,11 @@
package org.springframework.boot.docker.compose.service.connection.pulsar;
import org.springframework.boot.autoconfigure.pulsar.PulsarConnectionDetails;
import org.springframework.boot.docker.compose.core.ConnectionPorts;
import org.springframework.boot.docker.compose.core.RunningService;
import org.springframework.boot.docker.compose.service.connection.DockerComposeConnectionDetailsFactory;
import org.springframework.boot.docker.compose.service.connection.DockerComposeConnectionSource;
import org.springframework.boot.pulsar.autoconfigure.PulsarConnectionDetails;
/**
* {@link DockerComposeConnectionDetailsFactory} to create {@link PulsarConnectionDetails}

View File

@ -71,6 +71,7 @@ dependencies {
autoConfiguration(project(path: ":spring-boot-project:spring-boot-kafka", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-liquibase", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-mail", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-pulsar", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-reactor-netty", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-testcontainers", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-tomcat", configuration: "autoConfigurationMetadata"))
@ -98,6 +99,7 @@ dependencies {
configurationProperties(project(path: ":spring-boot-project:spring-boot-kafka", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-liquibase", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-mail", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-pulsar", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-reactor-netty", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-test-autoconfigure", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-testcontainers", configuration: "configurationPropertiesMetadata"))

View File

@ -0,0 +1,31 @@
plugins {
id "java-library"
id "org.springframework.boot.auto-configuration"
id "org.springframework.boot.configuration-properties"
id "org.springframework.boot.deployed"
id "org.springframework.boot.docker-test"
id "org.springframework.boot.optional-dependencies"
}
description = "Spring Boot Pulsar"
dependencies {
api(project(":spring-boot-project:spring-boot"))
api("org.springframework.pulsar:spring-pulsar")
dockerTestImplementation(project(":spring-boot-project:spring-boot-test"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
dockerTestImplementation("org.testcontainers:junit-jupiter")
dockerTestImplementation("org.testcontainers:pulsar")
optional("org.springframework.pulsar:spring-pulsar-reactive")
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
testImplementation(project(":spring-boot-project:spring-boot-test"))
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
testImplementation("com.github.ben-manes.caffeine:caffeine")
testImplementation("org.springframework.pulsar:spring-pulsar-cache-provider-caffeine")
testRuntimeOnly("ch.qos.logback:logback-classic")
}

View File

@ -26,23 +26,17 @@ import org.testcontainers.junit.jupiter.Testcontainers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration;
import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration;
import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration;
import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration;
import org.springframework.boot.pulsar.autoconfigure.PulsarAutoConfiguration;
import org.springframework.boot.pulsar.autoconfigure.PulsarReactiveAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.boot.testsupport.container.TestImage;
import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.pulsar.annotation.PulsarListener;
import org.springframework.pulsar.core.PulsarTemplate;
import org.springframework.stereotype.Service;
import org.springframework.test.context.DynamicPropertyRegistry;
import org.springframework.test.context.DynamicPropertySource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import static org.assertj.core.api.Assertions.assertThat;
@ -52,7 +46,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Chris Bono
* @author Phillip Webb
*/
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@SpringBootTest
@Testcontainers(disabledWithoutDocker = true)
class PulsarAutoConfigurationIntegrationTests {
@ -76,16 +70,14 @@ class PulsarAutoConfigurationIntegrationTests {
}
@Test
void templateCanBeAccessedDuringWebRequest(@Autowired TestRestTemplate restTemplate) throws InterruptedException {
assertThat(restTemplate.getForObject("/hello", String.class)).startsWith("Hello World -> ");
void sendAndReceive(@Autowired TestService testService) throws InterruptedException {
assertThat(testService.sayHello()).startsWith("Hello World -> ");
assertThat(listenLatch.await(5, TimeUnit.SECONDS)).isTrue();
}
@Configuration(proxyBeanMethods = false)
@ImportAutoConfiguration({ DispatcherServletAutoConfiguration.class, TomcatServletWebServerAutoConfiguration.class,
WebMvcAutoConfiguration.class, HttpMessageConvertersAutoConfiguration.class, JacksonAutoConfiguration.class,
PulsarAutoConfiguration.class, PulsarReactiveAutoConfiguration.class })
@Import(TestWebController.class)
@ImportAutoConfiguration({ PulsarAutoConfiguration.class, PulsarReactiveAutoConfiguration.class })
@Import(TestService.class)
static class TestConfiguration {
@PulsarListener(subscriptionName = TOPIC + "-sub", topics = TOPIC)
@ -95,16 +87,15 @@ class PulsarAutoConfigurationIntegrationTests {
}
@RestController
static class TestWebController {
@Service
static class TestService {
private final PulsarTemplate<String> pulsarTemplate;
TestWebController(PulsarTemplate<String> pulsarTemplate) {
TestService(PulsarTemplate<String> pulsarTemplate) {
this.pulsarTemplate = pulsarTemplate;
}
@GetMapping("/hello")
String sayHello() {
return "Hello World -> " + this.pulsarTemplate.send(TOPIC, "hello");
}

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.pulsar;
package org.springframework.boot.pulsar.autoconfigure;
import org.apache.pulsar.client.api.DeadLetterPolicy;
import org.apache.pulsar.client.api.DeadLetterPolicy.DeadLetterPolicyBuilder;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.pulsar;
package org.springframework.boot.pulsar.autoconfigure;
/**
* Adapts {@link PulsarProperties} to {@link PulsarConnectionDetails}.

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.pulsar;
package org.springframework.boot.pulsar.autoconfigure;
import java.util.ArrayList;
import java.util.List;
@ -69,7 +69,7 @@ import org.springframework.pulsar.transaction.PulsarTransactionManager;
* @author Alexander Preuß
* @author Phillip Webb
* @author Jonas Geiregat
* @since 3.2.0
* @since 4.0.0
*/
@AutoConfiguration
@ConditionalOnClass({ PulsarClient.class, PulsarTemplate.class })

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.pulsar;
package org.springframework.boot.pulsar.autoconfigure;
import java.util.ArrayList;
import java.util.List;
@ -30,9 +30,9 @@ import org.springframework.beans.factory.ObjectProvider;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.pulsar.PulsarProperties.Defaults.SchemaInfo;
import org.springframework.boot.autoconfigure.pulsar.PulsarProperties.Defaults.TypeMapping;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.pulsar.autoconfigure.PulsarProperties.Defaults.SchemaInfo;
import org.springframework.boot.pulsar.autoconfigure.PulsarProperties.Defaults.TypeMapping;
import org.springframework.boot.util.LambdaSafe;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.pulsar;
package org.springframework.boot.pulsar.autoconfigure;
import org.springframework.boot.autoconfigure.service.connection.ConnectionDetails;
@ -22,7 +22,7 @@ import org.springframework.boot.autoconfigure.service.connection.ConnectionDetai
* Details required to establish a connection to a Pulsar service.
*
* @author Chris Bono
* @since 3.2.0
* @since 4.0.0
*/
public interface PulsarConnectionDetails extends ConnectionDetails {

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.pulsar;
package org.springframework.boot.pulsar.autoconfigure;
import org.springframework.pulsar.config.PulsarContainerFactory;
@ -25,7 +25,7 @@ import org.springframework.pulsar.config.PulsarContainerFactory;
*
* @param <T> the type of the {@link PulsarContainerFactory}
* @author Chris Bono
* @since 3.4.0
* @since 4.0.0
*/
@FunctionalInterface
public interface PulsarContainerFactoryCustomizer<T extends PulsarContainerFactory<?, ?>> {

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.pulsar;
package org.springframework.boot.pulsar.autoconfigure;
import java.util.ArrayList;
import java.util.Collections;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.pulsar;
package org.springframework.boot.pulsar.autoconfigure;
import java.time.Duration;
import java.util.ArrayList;
@ -45,7 +45,7 @@ import org.springframework.util.Assert;
* @author Phillip Webb
* @author Swamy Mavuri
* @author Vedran Pavic
* @since 3.2.0
* @since 4.0.0
*/
@ConfigurationProperties("spring.pulsar")
public class PulsarProperties {

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.pulsar;
package org.springframework.boot.pulsar.autoconfigure;
import java.time.Duration;
import java.util.ArrayList;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.pulsar;
package org.springframework.boot.pulsar.autoconfigure;
import java.time.Duration;
import java.util.ArrayList;
@ -65,7 +65,7 @@ import org.springframework.pulsar.reactive.listener.ReactivePulsarContainerPrope
*
* @author Chris Bono
* @author Christophe Bornet
* @since 3.2.0
* @since 4.0.0
*/
@AutoConfiguration(after = PulsarAutoConfiguration.class)
@ConditionalOnClass({ PulsarClient.class, ReactivePulsarClient.class, ReactivePulsarTemplate.class })

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.pulsar;
package org.springframework.boot.pulsar.autoconfigure;
import java.util.ArrayList;

View File

@ -17,4 +17,4 @@
/**
* Auto-configuration for Spring for Apache Pulsar.
*/
package org.springframework.boot.autoconfigure.pulsar;
package org.springframework.boot.pulsar.autoconfigure;

View File

@ -0,0 +1,22 @@
{
"properties": [
{
"name": "spring.pulsar.defaults.topic.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable default tenant and namespace support for topics.",
"defaultValue": true
},
{
"name": "spring.pulsar.function.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable function support.",
"defaultValue": true
},
{
"name": "spring.pulsar.producer.cache.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable caching in the PulsarProducerFactory.",
"defaultValue": true
}
]
}

View File

@ -0,0 +1,2 @@
org.springframework.boot.pulsar.autoconfigure.PulsarAutoConfiguration
org.springframework.boot.pulsar.autoconfigure.PulsarReactiveAutoConfiguration

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.pulsar;
package org.springframework.boot.pulsar.autoconfigure;
import java.util.List;
import java.util.function.BiConsumer;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.pulsar;
package org.springframework.boot.pulsar.autoconfigure;
import org.apache.pulsar.client.api.DeadLetterPolicy;
import org.junit.jupiter.api.Test;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.pulsar;
package org.springframework.boot.pulsar.autoconfigure;
import java.io.IOException;
import java.util.HashMap;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.pulsar;
package org.springframework.boot.pulsar.autoconfigure;
import org.junit.jupiter.api.Test;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.pulsar;
package org.springframework.boot.pulsar.autoconfigure;
import java.util.ArrayList;
import java.util.List;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.pulsar;
package org.springframework.boot.pulsar.autoconfigure;
import java.time.Duration;
import java.util.ArrayList;
@ -139,7 +139,8 @@ class PulsarConfigurationTests {
"spring.pulsar.client.failover.switch-back-delay=30s",
"spring.pulsar.client.failover.check-interval=5s",
"spring.pulsar.client.failover.backup-clusters[1].service-url=backup-cluster-2",
"spring.pulsar.client.failover.backup-clusters[1].authentication.plugin-class-name=org.springframework.boot.autoconfigure.pulsar.MockAuthentication",
"spring.pulsar.client.failover.backup-clusters[1].authentication.plugin-class-name="
+ MockAuthentication.class.getName(),
"spring.pulsar.client.failover.backup-clusters[1].authentication.param.token=1234")
.run((context) -> {
DefaultPulsarClientFactory clientFactory = context.getBean(DefaultPulsarClientFactory.class);

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.pulsar;
package org.springframework.boot.pulsar.autoconfigure;
import java.util.ArrayList;
import java.util.Collections;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.pulsar;
package org.springframework.boot.pulsar.autoconfigure;
import java.time.Duration;
import java.util.List;
@ -39,8 +39,8 @@ import org.apache.pulsar.client.impl.AutoClusterFailover;
import org.apache.pulsar.common.schema.SchemaType;
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.pulsar.PulsarProperties.Consumer;
import org.springframework.boot.autoconfigure.pulsar.PulsarProperties.Failover.BackupCluster;
import org.springframework.boot.pulsar.autoconfigure.PulsarProperties.Consumer;
import org.springframework.boot.pulsar.autoconfigure.PulsarProperties.Failover.BackupCluster;
import org.springframework.pulsar.core.PulsarProducerFactory;
import org.springframework.pulsar.core.PulsarTemplate;
import org.springframework.pulsar.listener.PulsarContainerProperties;
@ -134,8 +134,7 @@ class PulsarPropertiesMapperTests {
BackupCluster backupCluster1 = new BackupCluster();
backupCluster1.setServiceUrl("backup-cluster-1");
Map<String, String> params = Map.of("param", "name");
backupCluster1.getAuthentication()
.setPluginClassName("org.springframework.boot.autoconfigure.pulsar.MockAuthentication");
backupCluster1.getAuthentication().setPluginClassName(MockAuthentication.class.getName());
backupCluster1.getAuthentication().setParam(params);
BackupCluster backupCluster2 = new BackupCluster();
backupCluster2.setServiceUrl("backup-cluster-2");

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.pulsar;
package org.springframework.boot.pulsar.autoconfigure;
import java.time.Duration;
import java.util.HashMap;
@ -34,13 +34,13 @@ import org.assertj.core.extractor.Extractors;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.pulsar.PulsarProperties.Defaults.SchemaInfo;
import org.springframework.boot.autoconfigure.pulsar.PulsarProperties.Defaults.TypeMapping;
import org.springframework.boot.autoconfigure.pulsar.PulsarProperties.Failover;
import org.springframework.boot.autoconfigure.pulsar.PulsarProperties.Failover.BackupCluster;
import org.springframework.boot.context.properties.bind.BindException;
import org.springframework.boot.context.properties.bind.Binder;
import org.springframework.boot.context.properties.source.MapConfigurationPropertySource;
import org.springframework.boot.pulsar.autoconfigure.PulsarProperties.Defaults.SchemaInfo;
import org.springframework.boot.pulsar.autoconfigure.PulsarProperties.Defaults.TypeMapping;
import org.springframework.boot.pulsar.autoconfigure.PulsarProperties.Failover;
import org.springframework.boot.pulsar.autoconfigure.PulsarProperties.Failover.BackupCluster;
import org.springframework.pulsar.core.PulsarTopicBuilder;
import static org.assertj.core.api.Assertions.assertThat;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.pulsar;
package org.springframework.boot.pulsar.autoconfigure;
import java.time.Duration;
import java.util.ArrayList;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.pulsar;
package org.springframework.boot.pulsar.autoconfigure;
import java.time.Duration;
import java.util.List;
@ -35,8 +35,8 @@ import org.apache.pulsar.reactive.client.api.ReactiveMessageReaderBuilder;
import org.apache.pulsar.reactive.client.api.ReactiveMessageSenderBuilder;
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.pulsar.PulsarProperties.Consumer;
import org.springframework.boot.autoconfigure.pulsar.PulsarProperties.Consumer.Subscription;
import org.springframework.boot.pulsar.autoconfigure.PulsarProperties.Consumer;
import org.springframework.boot.pulsar.autoconfigure.PulsarProperties.Consumer.Subscription;
import org.springframework.pulsar.reactive.listener.ReactivePulsarContainerProperties;
import static org.assertj.core.api.Assertions.assertThat;

View File

@ -6,6 +6,7 @@ description = "Starter for using Spring for Apache Pulsar Reactive"
dependencies {
api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter"))
api(project(":spring-boot-project:spring-boot-pulsar"))
api(project(":spring-boot-project:spring-boot-tx"))
api("org.springframework.pulsar:spring-pulsar-reactive")
}

View File

@ -6,8 +6,8 @@ description = "Starter for using Spring for Apache Pulsar"
dependencies {
api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter"))
api(project(":spring-boot-project:spring-boot-pulsar"))
api(project(":spring-boot-project:spring-boot-tx"))
api("org.springframework.pulsar:spring-pulsar")
}
checkRuntimeClasspathForConflicts {

View File

@ -17,6 +17,7 @@ dependencies {
dockerTestImplementation(project(":spring-boot-project:spring-boot-jdbc"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-kafka"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-liquibase"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-pulsar"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-test"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-tx"))
@ -67,6 +68,7 @@ dependencies {
optional(project(":spring-boot-project:spring-boot-jdbc"))
optional(project(":spring-boot-project:spring-boot-kafka"))
optional(project(":spring-boot-project:spring-boot-liquibase"))
optional(project(":spring-boot-project:spring-boot-pulsar"))
optional(project(":spring-boot-project:spring-boot-tx"))
optional("org.springframework:spring-test")
optional("org.springframework.data:spring-data-mongodb")
@ -103,7 +105,6 @@ dependencies {
testImplementation("org.springframework.amqp:spring-rabbit")
testImplementation("org.springframework.data:spring-data-redis")
testImplementation("org.springframework.kafka:spring-kafka")
testImplementation("org.springframework.pulsar:spring-pulsar")
testImplementation("org.testcontainers:junit-jupiter")
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -28,7 +28,7 @@ import org.testcontainers.junit.jupiter.Testcontainers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.autoconfigure.pulsar.PulsarAutoConfiguration;
import org.springframework.boot.pulsar.autoconfigure.PulsarAutoConfiguration;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.boot.testsupport.container.TestImage;
import org.springframework.context.annotation.Bean;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -18,7 +18,7 @@ package org.springframework.boot.testcontainers.service.connection.pulsar;
import org.testcontainers.containers.PulsarContainer;
import org.springframework.boot.autoconfigure.pulsar.PulsarConnectionDetails;
import org.springframework.boot.pulsar.autoconfigure.PulsarConnectionDetails;
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionDetailsFactory;
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionSource;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;