diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index b6616c0..9daee75 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -71,21 +71,21 @@ jobs: distribution: 'adopt' java-version: 17 - - name: install org.apache.pulsar.tests:integration:jar:tests:2.11.0 + - name: install org.apache.pulsar.tests:integration:jar:tests:3.0.7 if: ${{ steps.check_changes.outputs.docs_only != 'true' }} run: | cd ~ - git clone --depth 50 --single-branch --branch v2.11.0 https://github.com/apache/pulsar + git clone --depth 50 --single-branch --branch v3.0.7 https://github.com/apache/pulsar cd pulsar mvn -B -ntp -f tests/pom.xml -pl org.apache.pulsar.tests:tests-parent,org.apache.pulsar.tests:integration install - name: build apachepulsar/pulsar-test-latest-version:latest if: ${{ steps.check_changes.outputs.docs_only != 'true' }} run: | - docker pull apachepulsar/pulsar-all:2.11.0 - docker pull apachepulsar/pulsar:2.11.0 - docker tag apachepulsar/pulsar-all:2.11.0 apachepulsar/pulsar-all:latest - docker tag apachepulsar/pulsar:2.11.0 apachepulsar/pulsar:latest + docker pull apachepulsar/pulsar-all:3.0.7 + docker pull apachepulsar/pulsar:3.0.7 + docker tag apachepulsar/pulsar-all:3.0.7 apachepulsar/pulsar-all:latest + docker tag apachepulsar/pulsar:3.0.7 apachepulsar/pulsar:latest cd ~/pulsar mvn -B -ntp -f tests/docker-images/pom.xml install -pl org.apache.pulsar.tests:latest-version-image -am -Pdocker,-main -DskipTests diff --git a/README.md b/README.md index ce62338..7ebe364 100644 --- a/README.md +++ b/README.md @@ -34,11 +34,11 @@ mvn install In order to build this repository the linked Pulsar release must be released to Maven Central other wise you have to build it locally. -For instance if this code depends on Pulsar 2.11.0 you have to build Pulsar 2.11.0 locally +For instance if this code depends on Pulsar 3.0.7 you have to build Pulsar 3.0.7 locally ``` git clone https://github.com/apache/pulsar -git checkout v2.11.0 +git checkout v3.0.7 mvn clean install -DskipTests ``` diff --git a/examples/kafka-streams/pom.xml b/examples/kafka-streams/pom.xml index 8d29916..3817185 100644 --- a/examples/kafka-streams/pom.xml +++ b/examples/kafka-streams/pom.xml @@ -24,7 +24,7 @@ org.apache.pulsar.examples pulsar-adapters-examples - 2.11.0-SNAPSHOT + 3.0.7 kafka-streams @@ -35,7 +35,7 @@ org.apache.pulsar pulsar-client-kafka - 2.11.0-SNAPSHOT + 3.0.7 diff --git a/examples/pom.xml b/examples/pom.xml index b756c2e..ed17a82 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -25,7 +25,7 @@ org.apache.pulsar pulsar-adapters - 2.11.0-SNAPSHOT + 3.0.7 org.apache.pulsar.examples diff --git a/examples/spark/pom.xml b/examples/spark/pom.xml index 667373a..f59d037 100644 --- a/examples/spark/pom.xml +++ b/examples/spark/pom.xml @@ -25,7 +25,7 @@ org.apache.pulsar.examples pulsar-adapters-examples - 2.11.0-SNAPSHOT + 3.0.7 spark diff --git a/pom.xml b/pom.xml index 4f240d1..0f2cca6 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ org.apache.pulsar pulsar-adapters - 2.11.0-SNAPSHOT + 3.0.7 Pulsar Adapters A collections of Pulsar adapters. @@ -76,7 +76,7 @@ - 2.11.0 + 3.0.7 2.7.2 2.0.0 0.8.1.1 @@ -123,7 +123,7 @@ 3.0.0-M3 3.3.0 3.1.2 - 3.2.4 + 3.4.1 3.0.0 1.2.0 3.1.2 diff --git a/pulsar-client-kafka-compat/pom.xml b/pulsar-client-kafka-compat/pom.xml index d2c8b8a..5c965cf 100644 --- a/pulsar-client-kafka-compat/pom.xml +++ b/pulsar-client-kafka-compat/pom.xml @@ -27,7 +27,7 @@ org.apache.pulsar pulsar-adapters - 2.11.0-SNAPSHOT + 3.0.7 .. diff --git a/pulsar-client-kafka-compat/pulsar-client-kafka-shaded/pom.xml b/pulsar-client-kafka-compat/pulsar-client-kafka-shaded/pom.xml index 5d47d53..3be6ef6 100644 --- a/pulsar-client-kafka-compat/pulsar-client-kafka-shaded/pom.xml +++ b/pulsar-client-kafka-compat/pulsar-client-kafka-shaded/pom.xml @@ -27,7 +27,7 @@ org.apache.pulsar pulsar-client-kafka-compat - 2.11.0-SNAPSHOT + 3.0.7 .. diff --git a/pulsar-client-kafka-compat/pulsar-client-kafka-shaded_0_8/pom.xml b/pulsar-client-kafka-compat/pulsar-client-kafka-shaded_0_8/pom.xml index c04a999..22d68f9 100644 --- a/pulsar-client-kafka-compat/pulsar-client-kafka-shaded_0_8/pom.xml +++ b/pulsar-client-kafka-compat/pulsar-client-kafka-shaded_0_8/pom.xml @@ -27,7 +27,7 @@ org.apache.pulsar pulsar-client-kafka-compat - 2.11.0-SNAPSHOT + 3.0.7 .. diff --git a/pulsar-client-kafka-compat/pulsar-client-kafka-shaded_0_9/pom.xml b/pulsar-client-kafka-compat/pulsar-client-kafka-shaded_0_9/pom.xml index e100d8e..5c935dd 100644 --- a/pulsar-client-kafka-compat/pulsar-client-kafka-shaded_0_9/pom.xml +++ b/pulsar-client-kafka-compat/pulsar-client-kafka-shaded_0_9/pom.xml @@ -27,7 +27,7 @@ org.apache.pulsar pulsar-client-kafka-compat - 2.11.0-SNAPSHOT + 3.0.7 .. diff --git a/pulsar-client-kafka-compat/pulsar-client-kafka-tests/pom.xml b/pulsar-client-kafka-compat/pulsar-client-kafka-tests/pom.xml index 6f90950..9bbef89 100644 --- a/pulsar-client-kafka-compat/pulsar-client-kafka-tests/pom.xml +++ b/pulsar-client-kafka-compat/pulsar-client-kafka-tests/pom.xml @@ -27,7 +27,7 @@ org.apache.pulsar pulsar-client-kafka-compat - 2.11.0-SNAPSHOT + 3.0.7 .. @@ -36,6 +36,11 @@ Tests to verify the correct shading configuration for the pulsar-client-kafka wrapper + + 17 + 17 + + ${project.groupId} diff --git a/pulsar-client-kafka-compat/pulsar-client-kafka-tests_0_8/pom.xml b/pulsar-client-kafka-compat/pulsar-client-kafka-tests_0_8/pom.xml index 8e3246d..09117d9 100644 --- a/pulsar-client-kafka-compat/pulsar-client-kafka-tests_0_8/pom.xml +++ b/pulsar-client-kafka-compat/pulsar-client-kafka-tests_0_8/pom.xml @@ -27,7 +27,7 @@ org.apache.pulsar pulsar-client-kafka-compat - 2.11.0-SNAPSHOT + 3.0.7 .. @@ -36,6 +36,11 @@ Tests to verify the correct shading configuration for the pulsar-client-kafka wrapper + + 17 + 17 + + ${project.groupId} diff --git a/pulsar-client-kafka-compat/pulsar-client-kafka-tests_0_9/pom.xml b/pulsar-client-kafka-compat/pulsar-client-kafka-tests_0_9/pom.xml index 948ff0d..340eeab 100644 --- a/pulsar-client-kafka-compat/pulsar-client-kafka-tests_0_9/pom.xml +++ b/pulsar-client-kafka-compat/pulsar-client-kafka-tests_0_9/pom.xml @@ -27,7 +27,7 @@ org.apache.pulsar pulsar-client-kafka-compat - 2.11.0-SNAPSHOT + 3.0.7 .. @@ -36,6 +36,11 @@ Tests to verify the correct shading configuration for the pulsar-client-kafka wrapper + + 17 + 17 + + ${project.groupId} diff --git a/pulsar-client-kafka-compat/pulsar-client-kafka/pom.xml b/pulsar-client-kafka-compat/pulsar-client-kafka/pom.xml index 8667697..6b01afd 100644 --- a/pulsar-client-kafka-compat/pulsar-client-kafka/pom.xml +++ b/pulsar-client-kafka-compat/pulsar-client-kafka/pom.xml @@ -27,7 +27,7 @@ org.apache.pulsar pulsar-client-kafka-compat - 2.11.0-SNAPSHOT + 3.0.7 .. diff --git a/pulsar-client-kafka-compat/pulsar-client-kafka/src/main/java/org/apache/kafka/clients/consumer/PulsarKafkaConsumer.java b/pulsar-client-kafka-compat/pulsar-client-kafka/src/main/java/org/apache/kafka/clients/consumer/PulsarKafkaConsumer.java index 83fb86a..67d052b 100644 --- a/pulsar-client-kafka-compat/pulsar-client-kafka/src/main/java/org/apache/kafka/clients/consumer/PulsarKafkaConsumer.java +++ b/pulsar-client-kafka-compat/pulsar-client-kafka/src/main/java/org/apache/kafka/clients/consumer/PulsarKafkaConsumer.java @@ -261,7 +261,8 @@ public void subscribe(Collection topics, ConsumerRebalanceListener callb for (String topic : topics) { // Create individual subscription on each partition, that way we can keep using the // acknowledgeCumulative() - int numberOfPartitions = ((PulsarClientImpl) client).getNumberOfPartitions(topic).get(); + int numberOfPartitions = ((PulsarClientImpl) client).getPartitionedTopicMetadata(topic, true, false) + .thenApply(metadata -> metadata.partitions).get(); ConsumerBuilder consumerBuilder = PulsarConsumerKafkaConfig.getConsumerBuilder(client, properties); consumerBuilder.subscriptionType(SubscriptionType.Failover); diff --git a/pulsar-client-kafka-compat/pulsar-client-kafka/src/test/java/org/apache/kafka/clients/producer/PulsarKafkaProducerTest.java b/pulsar-client-kafka-compat/pulsar-client-kafka/src/test/java/org/apache/kafka/clients/producer/PulsarKafkaProducerTest.java index b4a7e79..4fb58a2 100644 --- a/pulsar-client-kafka-compat/pulsar-client-kafka/src/test/java/org/apache/kafka/clients/producer/PulsarKafkaProducerTest.java +++ b/pulsar-client-kafka-compat/pulsar-client-kafka/src/test/java/org/apache/kafka/clients/producer/PulsarKafkaProducerTest.java @@ -96,7 +96,7 @@ public static class Bar { @ObjectFactory // Necessary to make PowerMockito.mockStatic work with TestNG. public IObjectFactory getObjectFactory() { - return new org.powermock.modules.testng.PowerMockObjectFactory(); + return new org.powermock.modules.testng.internal.PowerMockClassloaderObjectFactory(); } @Test diff --git a/pulsar-client-kafka-compat/pulsar-client-kafka_0_8/pom.xml b/pulsar-client-kafka-compat/pulsar-client-kafka_0_8/pom.xml index 03557b1..9747e8e 100644 --- a/pulsar-client-kafka-compat/pulsar-client-kafka_0_8/pom.xml +++ b/pulsar-client-kafka-compat/pulsar-client-kafka_0_8/pom.xml @@ -27,7 +27,7 @@ org.apache.pulsar pulsar-client-kafka-compat - 2.11.0-SNAPSHOT + 3.0.7 .. @@ -36,6 +36,11 @@ Kafka client library that publishes and consumes messages on Pulsar topics + + 17 + 17 + + diff --git a/pulsar-client-kafka-compat/pulsar-client-kafka_0_9/pom.xml b/pulsar-client-kafka-compat/pulsar-client-kafka_0_9/pom.xml index c4e9b15..5315723 100644 --- a/pulsar-client-kafka-compat/pulsar-client-kafka_0_9/pom.xml +++ b/pulsar-client-kafka-compat/pulsar-client-kafka_0_9/pom.xml @@ -27,7 +27,7 @@ org.apache.pulsar pulsar-client-kafka-compat - 2.11.0-SNAPSHOT + 3.0.7 .. diff --git a/pulsar-client-kafka-compat/pulsar-client-kafka_0_9/src/main/java/org/apache/kafka/clients/consumer/PulsarKafkaConsumer.java b/pulsar-client-kafka-compat/pulsar-client-kafka_0_9/src/main/java/org/apache/kafka/clients/consumer/PulsarKafkaConsumer.java index 0a3526b..0f65107 100644 --- a/pulsar-client-kafka-compat/pulsar-client-kafka_0_9/src/main/java/org/apache/kafka/clients/consumer/PulsarKafkaConsumer.java +++ b/pulsar-client-kafka-compat/pulsar-client-kafka_0_9/src/main/java/org/apache/kafka/clients/consumer/PulsarKafkaConsumer.java @@ -212,7 +212,8 @@ public void subscribe(List topics, ConsumerRebalanceListener callback) { for (String topic : topics) { // Create individual subscription on each partition, that way we can keep using the // acknowledgeCumulative() - int numberOfPartitions = ((PulsarClientImpl) client).getNumberOfPartitions(topic).get(); + int numberOfPartitions = ((PulsarClientImpl) client).getPartitionedTopicMetadata(topic, true, false) + .thenApply(metadata -> metadata.partitions).get(); ConsumerBuilder consumerBuilder = PulsarConsumerKafkaConfig.getConsumerBuilder(client, properties); consumerBuilder.subscriptionType(SubscriptionType.Failover); diff --git a/pulsar-client-kafka-compat/pulsar-client-kafka_0_9/src/test/java/org/apache/kafka/clients/producer/PulsarKafkaProducerTest.java b/pulsar-client-kafka-compat/pulsar-client-kafka_0_9/src/test/java/org/apache/kafka/clients/producer/PulsarKafkaProducerTest.java index 4d12418..727113e 100644 --- a/pulsar-client-kafka-compat/pulsar-client-kafka_0_9/src/test/java/org/apache/kafka/clients/producer/PulsarKafkaProducerTest.java +++ b/pulsar-client-kafka-compat/pulsar-client-kafka_0_9/src/test/java/org/apache/kafka/clients/producer/PulsarKafkaProducerTest.java @@ -87,7 +87,7 @@ public static class Bar { @ObjectFactory // Necessary to make PowerMockito.mockStatic work with TestNG. public IObjectFactory getObjectFactory() { - return new org.powermock.modules.testng.PowerMockObjectFactory(); + return new org.powermock.modules.testng.internal.PowerMockClassloaderObjectFactory(); } @Test diff --git a/pulsar-log4j2-appender/pom.xml b/pulsar-log4j2-appender/pom.xml index b55fca7..09f54d7 100644 --- a/pulsar-log4j2-appender/pom.xml +++ b/pulsar-log4j2-appender/pom.xml @@ -24,7 +24,7 @@ org.apache.pulsar pulsar-adapters - 2.11.0-SNAPSHOT + 3.0.7 .. diff --git a/pulsar-spark/pom.xml b/pulsar-spark/pom.xml index f10b167..a6bd89e 100644 --- a/pulsar-spark/pom.xml +++ b/pulsar-spark/pom.xml @@ -26,7 +26,7 @@ org.apache.pulsar pulsar-adapters - 2.11.0-SNAPSHOT + 3.0.7 .. diff --git a/pulsar-storm/pom.xml b/pulsar-storm/pom.xml index a20649b..4fad85e 100644 --- a/pulsar-storm/pom.xml +++ b/pulsar-storm/pom.xml @@ -26,7 +26,7 @@ org.apache.pulsar pulsar-adapters - 2.11.0-SNAPSHOT + 3.0.7 .. diff --git a/pulsar-storm/src/main/java/org/apache/pulsar/storm/PulsarBolt.java b/pulsar-storm/src/main/java/org/apache/pulsar/storm/PulsarBolt.java index 32fa78f..8b4fd86 100644 --- a/pulsar-storm/src/main/java/org/apache/pulsar/storm/PulsarBolt.java +++ b/pulsar-storm/src/main/java/org/apache/pulsar/storm/PulsarBolt.java @@ -128,8 +128,6 @@ public void execute(Tuple input) { } collector.ack(input); } else { - final long messageSizeToBeSent = ((TypedMessageBuilderImpl) msgBuilder).getContent() - .remaining(); msgBuilder.sendAsync().handle((msgId, ex) -> { synchronized (collector) { if (ex != null) { @@ -140,7 +138,7 @@ public void execute(Tuple input) { } else { collector.ack(input); ++messagesSent; - messageSizeSent += messageSizeToBeSent; + messageSizeSent += ((TypedMessageBuilderImpl) msgBuilder).getContent().remaining(); if (LOG.isDebugEnabled()) { LOG.debug("[{}] Message sent with id {}", boltId, msgId); } diff --git a/pulsar-storm/src/main/java/org/apache/pulsar/storm/PulsarSpout.java b/pulsar-storm/src/main/java/org/apache/pulsar/storm/PulsarSpout.java index 8ed090e..797f340 100644 --- a/pulsar-storm/src/main/java/org/apache/pulsar/storm/PulsarSpout.java +++ b/pulsar-storm/src/main/java/org/apache/pulsar/storm/PulsarSpout.java @@ -39,7 +39,7 @@ import org.apache.pulsar.client.api.PulsarClient; import org.apache.pulsar.client.api.PulsarClientException; import org.apache.pulsar.client.api.Reader; -import org.apache.pulsar.client.impl.Backoff; +import org.apache.pulsar.common.util.Backoff; import org.apache.pulsar.client.impl.ClientBuilderImpl; import org.apache.pulsar.client.impl.conf.ClientConfigurationData; import org.apache.pulsar.client.impl.conf.ConsumerConfigurationData; diff --git a/tests/pom.xml b/tests/pom.xml index 18ccb15..7d4b68d 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -26,7 +26,7 @@ org.apache.pulsar pulsar-adapters - 2.11.0-SNAPSHOT + 3.0.7 org.apache.pulsar.tests adapters-tests-parent diff --git a/tests/pulsar-kafka-compat-client-test/pom.xml b/tests/pulsar-kafka-compat-client-test/pom.xml index 1a9095c..c3593ed 100644 --- a/tests/pulsar-kafka-compat-client-test/pom.xml +++ b/tests/pulsar-kafka-compat-client-test/pom.xml @@ -25,7 +25,7 @@ org.apache.pulsar.tests adapters-tests-parent - 2.11.0-SNAPSHOT + 3.0.7 pulsar-kafka-compat-client-test diff --git a/tests/pulsar-spark-test/pom.xml b/tests/pulsar-spark-test/pom.xml index 7078978..8346d77 100644 --- a/tests/pulsar-spark-test/pom.xml +++ b/tests/pulsar-spark-test/pom.xml @@ -26,7 +26,7 @@ org.apache.pulsar.tests adapters-tests-parent - 2.11.0-SNAPSHOT + 3.0.7 pulsar-spark-test @@ -41,7 +41,7 @@ org.apache.pulsar pulsar-spark - 2.11.0-SNAPSHOT + 3.0.7 test diff --git a/tests/pulsar-storm-test/pom.xml b/tests/pulsar-storm-test/pom.xml index 3134328..f93defc 100644 --- a/tests/pulsar-storm-test/pom.xml +++ b/tests/pulsar-storm-test/pom.xml @@ -26,19 +26,24 @@ org.apache.pulsar.tests adapters-tests-parent - 2.11.0-SNAPSHOT + 3.0.7 pulsar-storm-test jar Pulsar Storm adapter Tests + + 17 + 17 + + org.apache.pulsar pulsar-storm - 2.11.0-SNAPSHOT + 3.0.7 test