This is an automated email from the ASF dual-hosted git repository. orpiske pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-examples.git
The following commit(s) were added to refs/heads/main by this push: new ee3acd54 CAMEL-14184: adjust examples based on recent API changes ee3acd54 is described below commit ee3acd5425c8822b2534916e87581c15114c008a Author: Otavio Rodolfo Piske <angusyo...@gmail.com> AuthorDate: Mon Oct 24 16:05:40 2022 +0200 CAMEL-14184: adjust examples based on recent API changes --- .../org/apache/camel/example/resume/aws/kinesis/main/MainApp.java | 6 +++--- .../org/apache/camel/example/resume/cassandra/main/MainApp.java | 3 +-- .../org/apache/camel/example/resume/strategies/kafka/KafkaUtil.java | 5 ++--- .../resume/strategies/kafka/fileset/LargeDirectoryRouteBuilder.java | 2 +- .../org/apache/camel/example/resume/file/offset/main/MainApp.java | 3 +-- .../resume/fileset/clusterized/main/ClusterizedListener.java | 3 +-- .../java/org/apache/camel/example/resume/fileset/main/MainApp.java | 3 +-- 7 files changed, 10 insertions(+), 15 deletions(-) diff --git a/examples/resume-api/resume-api-aws2-kinesis/src/main/java/org/apache/camel/example/resume/aws/kinesis/main/MainApp.java b/examples/resume-api/resume-api-aws2-kinesis/src/main/java/org/apache/camel/example/resume/aws/kinesis/main/MainApp.java index e8663671..9cfdd59b 100644 --- a/examples/resume-api/resume-api-aws2-kinesis/src/main/java/org/apache/camel/example/resume/aws/kinesis/main/MainApp.java +++ b/examples/resume-api/resume-api-aws2-kinesis/src/main/java/org/apache/camel/example/resume/aws/kinesis/main/MainApp.java @@ -53,7 +53,7 @@ public class MainApp { return; } - SingleNodeKafkaResumeStrategy<Resumable> resumeStrategy = getUpdatableConsumerResumeStrategyForSet(); + SingleNodeKafkaResumeStrategy resumeStrategy = getUpdatableConsumerResumeStrategyForSet(); Integer batchSize = Integer.parseInt(System.getProperty("batch.size", "50")); CountDownLatch latch = new CountDownLatch(batchSize); @@ -65,7 +65,7 @@ public class MainApp { main.start(); } - private static SingleNodeKafkaResumeStrategy<Resumable> getUpdatableConsumerResumeStrategyForSet() { + private static SingleNodeKafkaResumeStrategy getUpdatableConsumerResumeStrategyForSet() { String bootStrapAddress = System.getProperty("bootstrap.address", "localhost:9092"); String kafkaTopic = System.getProperty("resume.type.kafka.topic", "offsets"); @@ -76,7 +76,7 @@ public class MainApp { .withTopic(kafkaTopic) .build(); - return new SingleNodeKafkaResumeStrategy<>(resumeStrategyConfiguration); + return new SingleNodeKafkaResumeStrategy(resumeStrategyConfiguration); } private static void loadData(KinesisClient client, String streamName, int recordCount) { diff --git a/examples/resume-api/resume-api-cassandraql/src/main/java/org/apache/camel/example/resume/cassandra/main/MainApp.java b/examples/resume-api/resume-api-cassandraql/src/main/java/org/apache/camel/example/resume/cassandra/main/MainApp.java index f1684efb..6606b3c6 100644 --- a/examples/resume-api/resume-api-cassandraql/src/main/java/org/apache/camel/example/resume/cassandra/main/MainApp.java +++ b/examples/resume-api/resume-api-cassandraql/src/main/java/org/apache/camel/example/resume/cassandra/main/MainApp.java @@ -25,7 +25,6 @@ import org.apache.camel.component.caffeine.resume.CaffeineCache; import org.apache.camel.example.resume.strategies.kafka.KafkaUtil; import org.apache.camel.main.Main; import org.apache.camel.processor.resume.kafka.SingleNodeKafkaResumeStrategy; -import org.apache.camel.resume.Resumable; public class MainApp { public static void main(String[] args) { @@ -48,7 +47,7 @@ public class MainApp { } // Normal code path for consuming from Cassandra - SingleNodeKafkaResumeStrategy<Resumable> resumeStrategy = KafkaUtil.getDefaultStrategy(); + SingleNodeKafkaResumeStrategy resumeStrategy = KafkaUtil.getDefaultStrategy(); Main main = new Main(); diff --git a/examples/resume-api/resume-api-common/src/main/java/org/apache/camel/example/resume/strategies/kafka/KafkaUtil.java b/examples/resume-api/resume-api-common/src/main/java/org/apache/camel/example/resume/strategies/kafka/KafkaUtil.java index 11b9783b..051c704e 100644 --- a/examples/resume-api/resume-api-common/src/main/java/org/apache/camel/example/resume/strategies/kafka/KafkaUtil.java +++ b/examples/resume-api/resume-api-common/src/main/java/org/apache/camel/example/resume/strategies/kafka/KafkaUtil.java @@ -22,14 +22,13 @@ import java.time.Duration; import org.apache.camel.processor.resume.kafka.KafkaResumeStrategyConfiguration; import org.apache.camel.processor.resume.kafka.KafkaResumeStrategyConfigurationBuilder; import org.apache.camel.processor.resume.kafka.SingleNodeKafkaResumeStrategy; -import org.apache.camel.resume.Resumable; public final class KafkaUtil { private KafkaUtil() { } - public static SingleNodeKafkaResumeStrategy<Resumable> getDefaultStrategy() { + public static SingleNodeKafkaResumeStrategy getDefaultStrategy() { String bootStrapAddress = System.getProperty("bootstrap.address", "localhost:9092"); String kafkaTopic = System.getProperty("resume.type.kafka.topic", "offsets"); @@ -41,6 +40,6 @@ public final class KafkaUtil { .withMaxInitializationDuration(Duration.ofSeconds(5)) .build(); - return new SingleNodeKafkaResumeStrategy<>(resumeStrategyConfiguration); + return new SingleNodeKafkaResumeStrategy(resumeStrategyConfiguration); } } diff --git a/examples/resume-api/resume-api-common/src/main/java/org/apache/camel/example/resume/strategies/kafka/fileset/LargeDirectoryRouteBuilder.java b/examples/resume-api/resume-api-common/src/main/java/org/apache/camel/example/resume/strategies/kafka/fileset/LargeDirectoryRouteBuilder.java index 9a34fdfd..2b537381 100644 --- a/examples/resume-api/resume-api-common/src/main/java/org/apache/camel/example/resume/strategies/kafka/fileset/LargeDirectoryRouteBuilder.java +++ b/examples/resume-api/resume-api-common/src/main/java/org/apache/camel/example/resume/strategies/kafka/fileset/LargeDirectoryRouteBuilder.java @@ -31,7 +31,7 @@ import org.slf4j.LoggerFactory; public class LargeDirectoryRouteBuilder extends RouteBuilder { private static final Logger LOG = LoggerFactory.getLogger(LargeDirectoryRouteBuilder.class); - private final KafkaResumeStrategy<Resumable> testResumeStrategy; + private final KafkaResumeStrategy testResumeStrategy; private final ResumeCache<File> cache; public LargeDirectoryRouteBuilder(KafkaResumeStrategy resumeStrategy, ResumeCache<File> cache) { diff --git a/examples/resume-api/resume-api-file-offset/src/main/java/org/apache/camel/example/resume/file/offset/main/MainApp.java b/examples/resume-api/resume-api-file-offset/src/main/java/org/apache/camel/example/resume/file/offset/main/MainApp.java index cfe99abe..26e11fdd 100644 --- a/examples/resume-api/resume-api-file-offset/src/main/java/org/apache/camel/example/resume/file/offset/main/MainApp.java +++ b/examples/resume-api/resume-api-file-offset/src/main/java/org/apache/camel/example/resume/file/offset/main/MainApp.java @@ -26,7 +26,6 @@ import org.apache.camel.example.resume.strategies.kafka.KafkaUtil; import org.apache.camel.example.resume.strategies.kafka.file.LargeFileRouteBuilder; import org.apache.camel.main.Main; import org.apache.camel.processor.resume.kafka.SingleNodeKafkaResumeStrategy; -import org.apache.camel.resume.Resumable; /** * A Camel Application @@ -43,7 +42,7 @@ public class MainApp { int batchSize = Integer.valueOf(tmp); CountDownLatch latch = new CountDownLatch(batchSize); - SingleNodeKafkaResumeStrategy<Resumable> resumeStrategy = KafkaUtil.getDefaultStrategy(); + SingleNodeKafkaResumeStrategy resumeStrategy = KafkaUtil.getDefaultStrategy(); RouteBuilder routeBuilder = new LargeFileRouteBuilder(resumeStrategy, new CaffeineCache<>(1), latch); main.configure().addRoutesBuilder(routeBuilder); diff --git a/examples/resume-api/resume-api-fileset-clusterized/src/main/java/org/apache/camel/example/resume/fileset/clusterized/main/ClusterizedListener.java b/examples/resume-api/resume-api-fileset-clusterized/src/main/java/org/apache/camel/example/resume/fileset/clusterized/main/ClusterizedListener.java index 42471c14..90f4dc1c 100644 --- a/examples/resume-api/resume-api-fileset-clusterized/src/main/java/org/apache/camel/example/resume/fileset/clusterized/main/ClusterizedListener.java +++ b/examples/resume-api/resume-api-fileset-clusterized/src/main/java/org/apache/camel/example/resume/fileset/clusterized/main/ClusterizedListener.java @@ -24,7 +24,6 @@ import org.apache.camel.example.resume.strategies.kafka.KafkaUtil; import org.apache.camel.main.BaseMainSupport; import org.apache.camel.main.MainListener; import org.apache.camel.processor.resume.kafka.SingleNodeKafkaResumeStrategy; -import org.apache.camel.resume.Resumable; import org.apache.camel.resume.ResumeStrategy; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -54,7 +53,7 @@ class ClusterizedListener implements MainListener { main.getCamelContext().addService(clusterService); LOG.trace("Creating the strategy"); - SingleNodeKafkaResumeStrategy<Resumable> resumeStrategy = KafkaUtil.getDefaultStrategy(); + SingleNodeKafkaResumeStrategy resumeStrategy = KafkaUtil.getDefaultStrategy(); main.getCamelContext().getRegistry().bind(ResumeStrategy.DEFAULT_NAME, resumeStrategy); LOG.trace("Creating the route"); diff --git a/examples/resume-api/resume-api-fileset/src/main/java/org/apache/camel/example/resume/fileset/main/MainApp.java b/examples/resume-api/resume-api-fileset/src/main/java/org/apache/camel/example/resume/fileset/main/MainApp.java index 1b8268e0..78837e69 100644 --- a/examples/resume-api/resume-api-fileset/src/main/java/org/apache/camel/example/resume/fileset/main/MainApp.java +++ b/examples/resume-api/resume-api-fileset/src/main/java/org/apache/camel/example/resume/fileset/main/MainApp.java @@ -24,7 +24,6 @@ import org.apache.camel.example.resume.strategies.kafka.check.CheckRoute; import org.apache.camel.example.resume.strategies.kafka.fileset.LargeDirectoryRouteBuilder; import org.apache.camel.main.Main; import org.apache.camel.processor.resume.kafka.SingleNodeKafkaResumeStrategy; -import org.apache.camel.resume.Resumable; /** * A Camel Application @@ -37,7 +36,7 @@ public class MainApp { public static void main(String... args) throws Exception { Main main = new Main(); - SingleNodeKafkaResumeStrategy<Resumable> resumeStrategy = KafkaUtil.getDefaultStrategy(); + SingleNodeKafkaResumeStrategy resumeStrategy = KafkaUtil.getDefaultStrategy(); RouteBuilder routeBuilder = new LargeDirectoryRouteBuilder(resumeStrategy, new CaffeineCache<>(10000)); main.configure().addRoutesBuilder(new CheckRoute());