Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=1.2.8-SNAPSHOT
version=2.0.0-SNAPSHOT
version.samples=1.2.8-SNAPSHOT

org.gradle.caching=true
Expand Down
10 changes: 5 additions & 5 deletions gradle/build-libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[versions]
asciidoc-gradle = "3.3.2"
commons-codec = "1.16.0"
commons-compress = "1.25.0"
commons-codec = "1.18.0"
commons-compress = "1.26.2"
groovy = "2.5.17"
jackson = "2.15.3"
javaformat = "0.0.41"
jackson = "2.19.1"
javaformat = "0.0.47"
jfrog = "4.31.9"
maven = "3.6.3"
nexus-publish = "1.3.0"
nohttp = "0.0.11"
sonarqube = "2.7.1"
spring = "6.1.2"
spring = "7.0.0-SNAPSHOT"
test-retry = "1.4.0"
versions = "0.50.0"
version-catalog-update = "0.8.1"
Expand Down
3 changes: 2 additions & 1 deletion gradle/java-conventions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ project.afterEvaluate {
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
options.compilerArgs.add("-parameters")
options.compilerArgs.addAll(["-Werror", "-Xlint:unchecked", "-Xlint:deprecation", "-Xlint:rawtypes", "-Xlint:varargs"]);
// TODO add this back in once we have removed deprecations
//options.compilerArgs.addAll(["-Werror", "-Xlint:unchecked", "-Xlint:rawtypes", "-Xlint:varargs"]);
options.release.set(17)
}
}
Expand Down
28 changes: 14 additions & 14 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
[versions]
# product
caffeine = "3.1.8"
caffeine = "3.2.1"
commons-compress = "1.26.2"
jackson = "2.18.4.1"
jackson = "2.19.1"
jsr305 = "3.0.2"
logback = "1.5.18"
micrometer = "1.14.8"
micrometer = "1.15.1"
micrometer-docs-gen = "1.0.4"
micrometer-tracing = "1.4.7"
micrometer-tracing = "1.5.1"
protobuf = "3.25.8"
pulsar = "3.3.7"
pulsar = "4.0.5"
pulsar-reactive = "0.7.0"
reactor = "2024.0.7"
spring = "6.2.8"
reactor = "2025.0.0-SNAPSHOT"
spring = "7.0.0-SNAPSHOT"
# tests
assertj = "3.27.3"
awaitility = "4.3.0"
jacoco = "0.8.9"
json-path = "2.9.0"
junit = "5.12.2"
hamcrest = "2.2"
mockito = "5.16.1"
junit = "5.13.1"
hamcrest = "3.0"
mockito = "5.17.0"
spring-dep-mgmt = "1.1.7"
spring-boot = "3.4.8-SNAPSHOT"
spring-boot-for-docs = "3.4.8-SNAPSHOT"
spring-cloud-stream = "4.2.0-SNAPSHOT"
spring-boot = "4.0.0-SNAPSHOT"
spring-boot-for-docs = "4.0.0-SNAPSHOT"
spring-cloud-stream = "5.0.0-SNAPSHOT"
spring-retry = "2.0.12"
system-lambda = "1.2.1"
testcontainers = "1.20.6"
testcontainers = "1.21.2"
# plugins
antora = "1.0.0"
antora-yml = "0.0.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.stream.IntStream;

import org.awaitility.Awaitility;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
Expand Down Expand Up @@ -73,6 +74,7 @@ void produceConsumeWithDefaultTenantNamespace(CapturedOutput output,
"spring.pulsar.defaults.topic.namespace=my-namespace-r" })
@ExtendWith(OutputCaptureExtension.class)
@ActiveProfiles("inttest.pulsar.reactive")
@Disabled("Flaky -> see https://github.com/spring-projects/spring-pulsar/issues/1040")
class WithReactiveApp {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration;
import org.springframework.boot.autoconfigure.pulsar.PulsarAutoConfiguration;
import org.springframework.boot.amqp.autoconfigure.RabbitAutoConfiguration;
import org.springframework.boot.pulsar.autoconfigure.PulsarAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ The following is the compatibility matrix:
|===
| Spring for Apache Pulsar | Pulsar Client | Pulsar Reactive Client | Spring Boot | Java

| 2.0.x
| 3.3.x / 4.0.x^**(*)**^
| 0.5.x - 0.7.x
| 4.0.x
| 17+

| 1.2.x
| 3.3.x / 4.0.x^**(*)**^
| 0.5.x - 0.7.x
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ These settings affect all listener containers, including the ones used by `@Puls

When not using Spring Boot, you can adjust these settings on the container factory that you provide.
However, when using Spring Boot, the container factory is auto-configured.
In this case you can register a `org.springframework.boot.autoconfigure.pulsar.PulsarContainerFactoryCustomizer<ConcurrentPulsarListenerContainerFactory<?>>` bean to access and customize the container properties.
In this case you can register a `org.springframework.boot.pulsar.autoconfigure.PulsarContainerFactoryCustomizer<ConcurrentPulsarListenerContainerFactory<?>>` bean to access and customize the container properties.
The following example shows how to set the timeout on the container factory:

[source, java]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ You can now configure the message listener container startup failure policy to `
For more details see the corresponding section for one of the supported containers xref:./reference/pulsar/message-consumption.adoc#message-listener-startup-failure[@PulsarListener], xref:./reference/pulsar/message-consumption.adoc#message-reader-startup-failure[@PulsarReader], or xref:./reference/reactive-pulsar/reactive-message-consumption.adoc#message-listener-startup-failure[@ReactivePulsarListener]

=== Message Container Factory Customizers (Spring Boot)
Spring Boot has introduced a generic message container factory customizer `org.springframework.boot.autoconfigure.pulsar.PulsarContainerFactoryCustomizer<T extends PulsarContainerFactory<?, ?>>` that can be used to further configure one or more of the auto-configured container factories that back the following listener annotations:
Spring Boot has introduced a generic message container factory customizer `org.springframework.boot.pulsar.autoconfigure.PulsarContainerFactoryCustomizer<T extends PulsarContainerFactory<?, ?>>` that can be used to further configure one or more of the auto-configured container factories that back the following listener annotations:

- For `@PulsarListener` register one or more PulsarContainerFactoryCustomizer<ConcurrentPulsarListenerContainerFactory<?>> beans.

Expand Down Expand Up @@ -50,9 +50,9 @@ As part of this, the following APIs were deprecated, copied, and renamed:

==== ConcurrentPulsarListenerContainerFactoryCustomizer
The purpose of `ConcurrentPulsarListenerContainerFactoryCustomizer` was to customize the Spring Boot auto-configured message container factories.
However, Spring Boot has introduced a generic message container factory customizer `org.springframework.boot.autoconfigure.pulsar.PulsarContainerFactoryCustomizer<T extends PulsarContainerFactory<?, ?>>` that removes the need for this customizer.
However, Spring Boot has introduced a generic message container factory customizer `org.springframework.boot.pulsar.autoconfigure.PulsarContainerFactoryCustomizer<T extends PulsarContainerFactory<?, ?>>` that removes the need for this customizer.

Replace all instances of `ConcurrentPulsarListenerContainerFactoryCustomizer` with `org.springframework.boot.autoconfigure.pulsar.PulsarContainerFactoryCustomizer<ConcurrentPulsarListenerContainerFactoryCustomizer<?>>`.
Replace all instances of `ConcurrentPulsarListenerContainerFactoryCustomizer` with `org.springframework.boot.pulsar.autoconfigure.PulsarContainerFactoryCustomizer<ConcurrentPulsarListenerContainerFactoryCustomizer<?>>`.

=== Removals
The following previously deprecated listener endpoint adapters have been removed in favor of default methods in the listener endpoint interfaces:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*
* @author Christophe Bornet
*/
public sealed interface ReactivePulsarMessageHandler permits ReactivePulsarOneByOneMessageHandler, ReactivePulsarStreamingHandler {
public sealed interface ReactivePulsarMessageHandler
permits ReactivePulsarOneByOneMessageHandler, ReactivePulsarStreamingHandler {

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
* @param <T> message type.
* @author Christophe Bornet
*/
public sealed interface ReactivePulsarMessageListenerContainer<T>
extends MessageListenerContainer permits DefaultReactivePulsarMessageListenerContainer {
public sealed interface ReactivePulsarMessageListenerContainer<T> extends MessageListenerContainer
permits DefaultReactivePulsarMessageListenerContainer {

void setupMessageHandler(ReactivePulsarMessageHandler messageListener);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ ext['pulsar.version'] = "${pulsarVersion}"
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-pulsar'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-zipkin'
implementation 'io.micrometer:micrometer-tracing-bridge-brave'
implementation 'io.zipkin.reporter2:zipkin-reporter-brave'
implementation 'io.zipkin.reporter2:zipkin-sender-urlconnection'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
pulsar:
image: 'apachepulsar/pulsar:3.3.6'
image: 'apachepulsar/pulsar:4.0.5'
ports:
- '6650'
- '8080'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
pulsar:
image: 'apachepulsar/pulsar:3.3.6'
image: 'apachepulsar/pulsar:4.0.5'
ports:
- '6650'
- '8080'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
pulsar:
image: 'apachepulsar/pulsar:3.3.6'
image: 'apachepulsar/pulsar:4.0.5'
ports:
- '6650'
- '8080'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

mkdir connectors
cd connectors
wget https://archive.apache.org/dist/pulsar/pulsar-3.3.6/connectors/pulsar-io-cassandra-3.3.6.nar
wget https://archive.apache.org/dist/pulsar/pulsar-3.3.6/connectors/pulsar-io-rabbitmq-3.3.6.nar
wget https://archive.apache.org/dist/pulsar/pulsar-4.0.5/connectors/pulsar-io-cassandra-4.0.5.nar
wget https://archive.apache.org/dist/pulsar/pulsar-4.0.5/connectors/pulsar-io-rabbitmq-4.0.5.nar
cd ..
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
pulsar:
image: 'apachepulsar/pulsar:3.3.6'
image: 'apachepulsar/pulsar:4.0.5'
ports:
- '6650'
- '8080'
Expand Down
2 changes: 1 addition & 1 deletion spring-pulsar-sample-apps/sample-reactive/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
pulsar:
image: 'apachepulsar/pulsar:3.3.6'
image: 'apachepulsar/pulsar:4.0.5'
ports:
- '6650'
- '8080'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public interface PulsarTestContainerSupport {
PulsarContainer PULSAR_CONTAINER = new PulsarContainer(getPulsarImage());

static DockerImageName getPulsarImage() {
return DockerImageName.parse("apachepulsar/pulsar:3.3.6");
return DockerImageName.parse("apachepulsar/pulsar:4.0.5");
}

@BeforeAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @param <T> The message payload type
* @author Chris Bono
* @deprecated since 1.2.0 for removal in 1.4.0 in favor of
* {@code org.springframework.boot.autoconfigure.pulsar.PulsarContainerFactoryCustomizer<ConcurrentPulsarListenerContainerFactory<?>>}
* {@code org.springframework.boot.pulsar.autoconfigure.PulsarContainerFactoryCustomizer<ConcurrentPulsarListenerContainerFactory<?>>}
*/
@FunctionalInterface
@Deprecated(since = "1.2.0", forRemoval = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
*
* @author Soby Chacko
*/
public sealed interface PulsarMessageListenerContainer
extends MessageListenerContainer permits AbstractPulsarMessageListenerContainer {
public sealed interface PulsarMessageListenerContainer extends MessageListenerContainer
permits AbstractPulsarMessageListenerContainer {

void setupMessageListener(Object messageListener);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
*
* @author Soby Chacko
*/
public sealed interface PulsarMessageReaderContainer
extends SmartLifecycle, DisposableBean permits AbstractPulsarMessageReaderContainer {
public sealed interface PulsarMessageReaderContainer extends SmartLifecycle, DisposableBean
permits AbstractPulsarMessageReaderContainer {

void setupReaderListener(Object messageListener);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ void provideFunctionsToBeanFactory() {
void createAdminClientFails() throws PulsarClientException {
when(springPulsarAdmin.createAdminClient()).thenThrow(new PulsarClientException("NOPE"));
assertThatThrownBy(() -> functionAdmin.createOrUpdateUserDefinedFunctions())
.isInstanceOf(PulsarException.class)
.hasMessageContaining("Unable to create/update functions - could not create PulsarAdmin: NOPE");
.isInstanceOf(PulsarException.class)
.hasMessageContaining("Unable to create/update functions - could not create PulsarAdmin: NOPE");
}

@Nested
Expand Down Expand Up @@ -472,8 +472,9 @@ void setStopPolicyOnFunctionsAndAddToProcessedList() {
void createAdminClientFails() throws PulsarClientException {
when(springPulsarAdmin.createAdminClient()).thenThrow(new PulsarClientException("NOPE"));
assertThatThrownBy(() -> functionAdmin.enforceStopPolicyOnUserDefinedFunctions())
.isInstanceOf(PulsarException.class).hasMessageContaining(
"Unable to enforce stop policy on functions - could not create PulsarAdmin: NOPE");
.isInstanceOf(PulsarException.class)
.hasMessageContaining(
"Unable to enforce stop policy on functions - could not create PulsarAdmin: NOPE");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void getIfExistsWithExistingFunction() throws PulsarAdminException {
@Test
void getIfExistsWithNonExistentFunction() throws PulsarAdminException {
when(pulsarAdmin.functions().getFunction(anyString(), anyString(), anyString()))
.thenThrow(new NotFoundException(null, "400", 400));
.thenThrow(new NotFoundException(null, "400", 400));
assertThat(function.getIfExists(pulsarAdmin)).isEmpty();
assertThat(function.functionExists(pulsarAdmin)).isFalse();
}
Expand Down Expand Up @@ -217,7 +217,7 @@ void getIfExistsWithExistingSink() throws PulsarAdminException {
@Test
void getIfExistsWithNonExistentSink() throws PulsarAdminException {
when(pulsarAdmin.sinks().getSink(anyString(), anyString(), anyString()))
.thenThrow(new NotFoundException(null, "400", 400));
.thenThrow(new NotFoundException(null, "400", 400));
assertThat(sink.getIfExists(pulsarAdmin)).isEmpty();
assertThat(sink.functionExists(pulsarAdmin)).isFalse();
}
Expand Down Expand Up @@ -331,7 +331,7 @@ void getIfExistsWithExistingSource() throws PulsarAdminException {
@Test
void getIfExistsWithNonExistentSource() throws PulsarAdminException {
when(pulsarAdmin.sources().getSource(anyString(), anyString(), anyString()))
.thenThrow(new NotFoundException(null, "400", 400));
.thenThrow(new NotFoundException(null, "400", 400));
assertThat(source.getIfExists(pulsarAdmin)).isEmpty();
assertThat(source.functionExists(pulsarAdmin)).isFalse();
}
Expand Down
2 changes: 1 addition & 1 deletion tools/pulsar/docker/standalone/pulsar-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
docker run -it -p 6650:6650 -p 8080:8080 \
--mount source=pulsardata,target=/pulsar/data \
--mount source=pulsarconf,target=/pulsar/conf \
apachepulsar/pulsar:3.3.6 \
apachepulsar/pulsar:4.0.5 \
bin/pulsar standalone