Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat : upgrade to spring boot 3.3.0-RC1 and polish #480

Merged
merged 3 commits into from
Apr 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM gitpod/workspace-full
USER root

RUN bash -c ". /home/gitpod/.sdkman/bin/sdkman-init.sh \
&& sdk install java 21.0.2-graalce \
&& sdk default java 21.0.2-graalce"
&& sdk install java 21.0.3-graalce \
&& sdk default java 21.0.3-graalce"


4 changes: 3 additions & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ image:
vscode:
extensions:
- vscjava.vscode-java-pack
- Vmware.vscode-boot-dev-pack
- GabrielBB.vscode-lombok
- ms-azuretools.vscode-docker
- redhat.java
- Pivotal.vscode-boot-dev-pack

ports:
- port: 5050
Expand All @@ -34,3 +34,5 @@ ports:
- port: 9411
visibility: public
onOpen: open-browser
: public
onOpen: open-browser
10 changes: 10 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@
"projectName": "spring-boot-multiple-producers-consumers",
"args": "",
"envFile": "${workspaceFolder}/.env"
},
{
"type": "java",
"name": "Spring Boot-TestCloudKafkaSampleApplication<kafka-spring-cloud-sample>",
"request": "launch",
"cwd": "${workspaceFolder}",
"mainClass": "com.example.cloudkafkasample.TestCloudKafkaSampleApplication",
"projectName": "kafka-spring-cloud-sample",
"args": "",
"envFile": "${workspaceFolder}/.env"
}
]
}
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,16 @@ Kafka has a number of key features that make it a popular choice for data proces

This repository contains sample projects integrating with kafka using different mechanisms available
rajadilipkolli marked this conversation as resolved.
Show resolved Hide resolved

- [avro](./kafka-avro/README.md)
- [Kafka avro type](./kafka-avro/README.md)
rajadilipkolli marked this conversation as resolved.
Show resolved Hide resolved
- [DSL integration](./kafka-dsl-integration/ReadMe.md)
- [reactor](./kafka-reactor/README.md)
- [sample](./kafka-sample)
- [sample](./kafka-sample/README.md)
- [Examples using spring boot](./kafka-spring-boot/README.md)
- [Kafka implementation using cloud bindings](./kafka-spring-cloud-sample/README.md)
- [kafka streams implementation](./kafka-streams/README.md)
rajadilipkolli marked this conversation as resolved.
Show resolved Hide resolved
- [Kafka implementation using cloud bindings](./spring-cloud/README.md)
- [Outbox Pattern Implementation using Modulith](./spring-modulith-outbox-pattern/README.md)
rajadilipkolli marked this conversation as resolved.
Show resolved Hide resolved




### Reference
rajadilipkolli marked this conversation as resolved.
Show resolved Hide resolved

Copied and modified from
Expand Down
4 changes: 2 additions & 2 deletions kafka-avro/spring-boot-kafka-avro-consumer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.5</version>
<version>3.3.0-RC1</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
Expand Down Expand Up @@ -158,7 +158,7 @@
<configuration>
<java>
<googleJavaFormat>
<version>1.18.1</version>
<version>1.19.2</version>
<style>AOSP</style>
</googleJavaFormat>
</java>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class SpringBootKafkaAvroConsumerApplicationTests {
@Autowired KafkaProducer kafkaProducer;

private static final Network KAFKA_NETWORK = Network.newNetwork();
private static final String CONFLUENT_PLATFORM_VERSION = "7.6.0";
private static final String CONFLUENT_PLATFORM_VERSION = "7.6.1";
private static final DockerImageName KAFKA_IMAGE =
DockerImageName.parse("confluentinc/cp-kafka").withTag(CONFLUENT_PLATFORM_VERSION);
private static final KafkaContainer KAFKA =
Expand Down
4 changes: 2 additions & 2 deletions kafka-avro/spring-boot-kafka-avro-producer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.5</version>
<version>3.3.0-RC1</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
Expand Down Expand Up @@ -154,7 +154,7 @@
<configuration>
<java>
<googleJavaFormat>
<version>1.18.1</version>
<version>1.19.2</version>
<style>AOSP</style>
</googleJavaFormat>
</java>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public Statement apply(Statement base, Description description) {
@Bean
@ServiceConnection
KafkaContainer kafkaContainer() {
return new KafkaRaftWithExtraListenersContainer("confluentinc/cp-kafka:7.6.0")
return new KafkaRaftWithExtraListenersContainer("confluentinc/cp-kafka:7.6.1")
.withAdditionalListener(() -> "kafka:19092")
.withKraft()
.withNetwork(network)
Expand All @@ -72,7 +72,7 @@ KafkaContainer kafkaContainer() {
@DependsOn("kafkaContainer")
GenericContainer<?> schemaregistry(DynamicPropertyRegistry dynamicPropertyRegistry) {
GenericContainer<?> schemaRegistry =
new GenericContainer<>("confluentinc/cp-schema-registry:7.6.0")
new GenericContainer<>("confluentinc/cp-schema-registry:7.6.1")
.withExposedPorts(8085)
.withNetworkAliases("schemaregistry")
.withNetwork(network)
Expand Down
25 changes: 23 additions & 2 deletions kafka-dsl-integration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.5</version>
<version>3.3.0-RC1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example.integration</groupId>
Expand Down Expand Up @@ -84,7 +84,7 @@
<configuration>
<java>
<palantirJavaFormat>
<version>2.40.0</version>
<version>2.42.0</version>
</palantirJavaFormat>
<importOrder />
<removeUnusedImports />
Expand All @@ -103,4 +103,25 @@
</plugins>
</build>

<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class TestKafkaDslApplication {
@ServiceConnection
KafkaContainer kafkaContainer(DynamicPropertyRegistry dynamicPropertyRegistry) {
KafkaContainer kafkaContainer = new KafkaContainer(
DockerImageName.parse("confluentinc/cp-kafka").withTag("7.6.0"))
DockerImageName.parse("confluentinc/cp-kafka").withTag("7.6.1"))
.withKraft();
// Connect our Spring application to our Testcontainers Kafka instance
dynamicPropertyRegistry.add("spring.kafka.bootstrap-servers", kafkaContainer::getBootstrapServers);
Expand Down
25 changes: 23 additions & 2 deletions kafka-reactor/boot-kafka-reactor-consumer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.5</version>
<version>3.3.0-RC1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example.boot.kafka.reactor</groupId>
Expand Down Expand Up @@ -143,7 +143,7 @@
<configuration>
<java>
<palantirJavaFormat>
<version>2.40.0</version>
<version>2.42.0</version>
</palantirJavaFormat>
<importOrder/>
<removeUnusedImports/>
Expand All @@ -162,4 +162,25 @@
</plugins>
</build>

<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
rajadilipkolli marked this conversation as resolved.
Show resolved Hide resolved

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ PostgreSQLContainer<?> postgresContainer() {
@ServiceConnection
KafkaContainer kafkaContainer(DynamicPropertyRegistry propertyRegistry) {
KafkaContainer kafkaContainer = new KafkaContainer(
DockerImageName.parse("confluentinc/cp-kafka").withTag("7.6.0"))
DockerImageName.parse("confluentinc/cp-kafka").withTag("7.6.1"))
.withKraft();
propertyRegistry.add("spring.kafka.bootstrapServers", kafkaContainer::getBootstrapServers);
return kafkaContainer;
Expand Down
4 changes: 2 additions & 2 deletions kafka-reactor/boot-kafka-reactor-producer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.5</version>
<version>3.3.0-RC1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example.boot.kafka.reactor</groupId>
Expand Down Expand Up @@ -105,7 +105,7 @@
<configuration>
<java>
<palantirJavaFormat>
<version>2.40.0</version>
<version>2.42.0</version>
</palantirJavaFormat>
<importOrder/>
<removeUnusedImports/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class TestBootKafkaReactorProducerApplication {
@ServiceConnection
KafkaContainer kafkaContainer(DynamicPropertyRegistry propertyRegistry) {
KafkaContainer kafkaContainer = new KafkaContainer(
DockerImageName.parse("confluentinc/cp-kafka").withTag("7.6.0"))
DockerImageName.parse("confluentinc/cp-kafka").withTag("7.6.1"))
.withKraft();
propertyRegistry.add("spring.kafka.bootstrapServers", kafkaContainer::getBootstrapServers);
return kafkaContainer;
Expand Down
2 changes: 1 addition & 1 deletion kafka-spring-boot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ This folder contains sample kafka producer and consumer using java, spring & Spr

| Type | Description |
|------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|
| [Spring Boot Kafka Sample](./boot-kafka-sample) | Producing and consuming Messages using Spring Boot |
| [Spring Boot Kafka Sample](./boot-kafka-sample) | Producing and consuming Messages using Spring Boot |
| [Multiple Producers & Consumers](./spring-boot-multiple-producers-consumers) | Producing and consuming Messages from Multiple Producer and consumers using Spring Boot |
2 changes: 1 addition & 1 deletion kafka-spring-boot/boot-kafka-sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.5</version>
<version>3.3.0-RC1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class TestBootKafkaSampleApplication {
@ServiceConnection
KafkaContainer kafkaContainer() {
KafkaContainer kafkaContainer = new KafkaContainer(
DockerImageName.parse("confluentinc/cp-kafka").withTag("7.6.0"))
DockerImageName.parse("confluentinc/cp-kafka").withTag("7.6.1"))
.withKraft();
kafkaContainer.addEnv("KAFKA_NUM_PARTITIONS", "32");
return kafkaContainer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.5</version>
<version>3.3.0-RC1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example.kafka</groupId>
Expand Down Expand Up @@ -166,4 +166,25 @@
</plugins>
</build>

<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ GenericContainer<?> zipkinContainer() {
@ServiceConnection
KafkaContainer kafkaContainer(DynamicPropertyRegistry dynamicPropertyRegistry) {
KafkaContainer kafkaContainer = new KafkaContainer(
DockerImageName.parse("confluentinc/cp-kafka").withTag("7.6.0"))
DockerImageName.parse("confluentinc/cp-kafka").withTag("7.6.1"))
.withKraft()
.withReuse(true);
// Connect our Spring application to our Testcontainers Kafka instance
Expand Down
2 changes: 1 addition & 1 deletion kafka-spring-cloud-sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.5</version>
<version>3.3.0-RC1</version>
rajadilipkolli marked this conversation as resolved.
Show resolved Hide resolved
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class TestCloudKafkaSampleApplication {
@ServiceConnection
KafkaContainer kafkaContainer(DynamicPropertyRegistry dynamicPropertyRegistry) {
KafkaContainer kafkaContainer = new KafkaContainer(
DockerImageName.parse("confluentinc/cp-kafka").withTag("7.6.0"))
DockerImageName.parse("confluentinc/cp-kafka").withTag("7.6.1"))
.withKraft()
.withReuse(true);
dynamicPropertyRegistry.add("spring.cloud.stream.kafka.binder.brokers", kafkaContainer::getBootstrapServers);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.5</version>
<version>3.3.0-RC1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
public class TestAnalyticsConsumerApplication {

private static final DockerImageName KAFKA_IMAGE_NAME =
DockerImageName.parse("confluentinc/cp-kafka").withTag("7.6.0");
DockerImageName.parse("confluentinc/cp-kafka").withTag("7.6.1");

@Bean
@ServiceConnection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.5</version>
<version>3.3.0-RC1</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class TestAnalyticsProducerApplication {
@ServiceConnection
KafkaContainer kafkaContainer(DynamicPropertyRegistry propertyRegistry) {
KafkaContainer kafkaContainer =
new KafkaContainer(DockerImageName.parse("confluentinc/cp-kafka").withTag("7.6.0"))
new KafkaContainer(DockerImageName.parse("confluentinc/cp-kafka").withTag("7.6.1"))
.withKraft();
propertyRegistry.add("spring.kafka.bootstrapServers", kafkaContainer::getBootstrapServers);
return kafkaContainer;
Expand Down
Loading
Loading