Skip to content

Commit

Permalink
BE: Chore: Upgrade java to 21 (#628)
Browse files Browse the repository at this point in the history
  • Loading branch information
sixdouglas authored Dec 10, 2024
1 parent 3c0cd73 commit 12f117c
Show file tree
Hide file tree
Showing 19 changed files with 43 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/backend_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'zulu'
cache: 'maven'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/branch-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'zulu'
cache: 'maven'
- name: Build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-public-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'zulu'
cache: 'maven'
- name: Build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'zulu'
cache: 'maven'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cve_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'zulu'
cache: 'maven'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
java-version: '21'
distribution: 'zulu'
cache: 'maven'

Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
java-version: '21'
distribution: 'zulu'
cache: 'maven'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'zulu'
cache: 'maven'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-serde-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: "17"
java-version: "21"
distribution: "zulu"
cache: "maven"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'zulu'
cache: 'maven'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/separate_env_public_create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'zulu'
cache: 'maven'
- name: Build
Expand Down
4 changes: 2 additions & 2 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# The tag is ignored when a sha is included but the reason to add it are:
# The tag is ignored when a sha is included but the reason to add it are:
# 1. Self Documentation: It is difficult to find out what the expected tag is given a sha alone
# 2. Helps dependabot during discovery of upgrades
FROM azul/zulu-openjdk-alpine:17-jre-headless-latest@sha256:af4df00adaec356d092651af50d9e80fd179f96722d267e79acb564aede10fda
FROM azul/zulu-openjdk-alpine:21.0.4-jre-headless@sha256:c6f58ac023a103283fd02d204462268ae5e29996bfe379f6cf11837355e93c98

RUN apk add --no-cache \
# snappy codec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public Mono<ResponseEntity<Map<String, ConnectorTopics>>> getConnectorTopicsWith
}

@Override
public Flux<String> getConnectors(String search) throws WebClientResponseException {
public Mono<List<String>> getConnectors(String search) throws WebClientResponseException {
return withRetryOnConflict(super.getConnectors(search));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ private Mono<List<ConsumerGroupDescription>> loadSortedDescriptions(ReactiveAdmi
case EMPTY -> 3;
case DEAD -> 4;
case UNKNOWN -> 5;
case ASSIGNING -> 6;
case RECONCILING -> 7;
};
var comparator = Comparator.comparingInt(statesPriorities);
yield loadDescriptionsByListings(ac, groups, comparator, pageNum, perPage, sortOrderDto);
Expand Down
13 changes: 1 addition & 12 deletions api/src/main/java/io/kafbat/ui/service/KafkaConnectService.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.kafbat.ui.service;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.kafbat.ui.connect.api.KafkaConnectClientApi;
import io.kafbat.ui.connect.model.ConnectorStatus;
Expand Down Expand Up @@ -31,7 +30,6 @@
import java.util.stream.Stream;
import javax.annotation.Nullable;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
Expand Down Expand Up @@ -106,10 +104,7 @@ public Mono<ConnectorTopics> getConnectorTopics(KafkaCluster cluster, String con

public Flux<String> getConnectorNames(KafkaCluster cluster, String connectName) {
return api(cluster, connectName)
.flux(client -> client.getConnectors(null))
// for some reason `getConnectors` method returns the response as a single string
.collectList().map(e -> e.get(0))
.map(this::parseConnectorsNamesStringToList)
.mono(client -> client.getConnectors(null))
.flatMapMany(Flux::fromIterable);
}

Expand All @@ -118,12 +113,6 @@ public Flux<String> getConnectorNamesWithErrorsSuppress(KafkaCluster cluster, St
return getConnectorNames(cluster, connectName).onErrorComplete();
}

@SneakyThrows
private List<String> parseConnectorsNamesStringToList(String json) {
return objectMapper.readValue(json, new TypeReference<>() {
});
}

public Mono<ConnectorDTO> createConnector(KafkaCluster cluster, String connectName,
Mono<NewConnectorDTO> connector) {
return api(cluster, connectName)
Expand Down
2 changes: 1 addition & 1 deletion documentation/compose/connectors/start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/bash
#! /bin/sh
while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' kafka-connect0:8083)" != "200" ]]
do sleep 5
done
Expand Down
4 changes: 2 additions & 2 deletions documentation/compose/e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,15 @@ services:
POSTGRES_PASSWORD: '12345'

create-connectors:
image: ellerbrock/alpine-bash-curl-ssl
image: curlimages/curl
depends_on:
postgres-db:
condition: service_healthy
kafka-connect0:
condition: service_healthy
volumes:
- ./connectors:/connectors
command: bash -c '/connectors/start.sh'
command: sh -c '/connectors/start.sh'

ksqldb:
image: confluentinc/cp-ksqldb-server:7.6.0
Expand Down
14 changes: 9 additions & 5 deletions e2e-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
<artifactId>e2e-tests</artifactId>

<properties>
<kafka.version>3.3.1</kafka.version>
<kafka.version>3.8.0</kafka.version>
<contract>${project.version}</contract>
<maven.compiler.release>17</maven.compiler.release>
<maven.surefire.release>3.2.3</maven.surefire.release>
<maven.surefire-testng>3.2.5</maven.surefire-testng>
<aspectj.version>1.9.9.1</aspectj.version>
<maven.compiler.release>21</maven.compiler.release>
<maven.surefire.release>3.5.1</maven.surefire.release>
<maven.surefire-testng>3.5.1</maven.surefire-testng>
<aspectj.version>1.9.21</aspectj.version>
<allure.version>2.27.0</allure.version>
</properties>

Expand Down Expand Up @@ -73,6 +73,10 @@
<artifactId>webdrivermanager</artifactId>
<version>5.8.0</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-resolver-dns-native-macos</artifactId>
</dependency>
</dependencies>

<profiles>
Expand Down
24 changes: 12 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</modules>

<properties>
<maven.compiler.release>17</maven.compiler.release>
<maven.compiler.release>21</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<frontend-generated-sources-directory>..//frontend/src/generated-sources
Expand All @@ -34,12 +34,12 @@
<apache.commons.version>2.12.0</apache.commons.version>
<assertj.version>3.25.3</assertj.version>
<avro.version>1.11.4</avro.version>
<byte-buddy.version>1.12.19</byte-buddy.version>
<byte-buddy.version>1.14.19</byte-buddy.version>
<confluent.version>7.4.4</confluent.version>
<datasketches-java.version>3.1.0</datasketches-java.version>
<groovy.version>3.0.13</groovy.version>
<jackson.version>2.14.0</jackson.version>
<kafka-clients.version>3.7.1</kafka-clients.version>
<kafka-clients.version>3.8.0</kafka-clients.version>
<org.mapstruct.version>1.6.2</org.mapstruct.version>
<org.projectlombok.version>1.18.34</org.projectlombok.version>
<protobuf-java.version>3.25.5</protobuf-java.version>
Expand All @@ -54,7 +54,7 @@
<guava.version>33.3.1-jre</guava.version>
<!-- Test dependency versions -->
<junit.version>5.11.2</junit.version>
<mockito.version>5.11.0</mockito.version>
<mockito.version>5.14.2</mockito.version>
<okhttp3.mockwebserver.version>4.12.0</okhttp3.mockwebserver.version>
<testcontainers.version>1.20.2</testcontainers.version>

Expand All @@ -63,14 +63,14 @@
<pnpm.version>v9.11.0</pnpm.version>

<!-- Plugin versions -->
<fabric8-maven-plugin.version>0.42.1</fabric8-maven-plugin.version>
<frontend-maven-plugin.version>1.12.1</frontend-maven-plugin.version>
<maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
<maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
<maven-resources-plugin.version>3.2.0</maven-resources-plugin.version>
<maven-surefire-plugin.version>3.1.2</maven-surefire-plugin.version>
<openapi-generator-maven-plugin.version>6.6.0</openapi-generator-maven-plugin.version>
<springdoc-openapi-webflux-ui.version>1.2.32</springdoc-openapi-webflux-ui.version>
<fabric8-maven-plugin.version>0.45.1</fabric8-maven-plugin.version>
<frontend-maven-plugin.version>1.15.1</frontend-maven-plugin.version>
<maven-clean-plugin.version>3.4.0</maven-clean-plugin.version>
<maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
<maven-surefire-plugin.version>3.5.1</maven-surefire-plugin.version>
<openapi-generator-maven-plugin.version>7.9.0</openapi-generator-maven-plugin.version>
<springdoc-openapi-webflux-ui.version>1.8.0</springdoc-openapi-webflux-ui.version>
</properties>

<repositories>
Expand Down
4 changes: 2 additions & 2 deletions serde-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<packaging>jar</packaging>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
</properties>

<distributionManagement>
Expand Down

0 comments on commit 12f117c

Please sign in to comment.