Skip to content

Commit

Permalink
Upgrade the kafka-client to 2.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sergii-iakovenko committed Jul 19, 2022
1 parent 89c7a0b commit 127d665
Show file tree
Hide file tree
Showing 20 changed files with 59 additions and 102 deletions.
5 changes: 1 addition & 4 deletions src-java/base-topology/base-storm-topology/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,7 @@ dependencies {
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'log4j', module: 'log4j'
}
api('org.apache.kafka:kafka_2.11') {
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'log4j', module: 'log4j'
}
testImplementation 'org.apache.kafka:kafka_2.13'

api 'io.micrometer:micrometer-core:1.8.2'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
import org.openkilda.wfm.config.ZookeeperConfig;

import com.google.common.io.Files;
import kafka.server.KafkaServerStartable;
import kafka.server.KafkaServer;
import org.apache.curator.test.TestingServer;
import org.apache.kafka.common.utils.Time;
import scala.Option;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -48,7 +50,7 @@ private static Properties serverProperties(ZookeeperConfig zookeeperConfig, Kafk

public static class KafkaTestFixture {
public TestingServer zk;
public KafkaServerStartable kafka;
public KafkaServer kafka;
public File tempDir = Files.createTempDir();
private ZookeeperConfig zooKeeperConfig;
private KafkaConfig kafkaConfig;
Expand All @@ -72,7 +74,7 @@ private void start(Properties props) throws Exception {

props.put("log.dirs", tempDir.getAbsolutePath());
kafka.server.KafkaConfig kafkaConfig = new kafka.server.KafkaConfig(props);
kafka = new KafkaServerStartable(kafkaConfig);
kafka = new KafkaServer(kafkaConfig, Time.SYSTEM, Option.empty(), false);
kafka.startup();
System.out.println("Started KAFKA: ");
}
Expand Down
9 changes: 5 additions & 4 deletions src-java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ subprojects {

implementation('org.apache.kafka:kafka-clients') {
version {
strictly '2.3.1'
strictly '2.8.1'
}
}
implementation('org.apache.kafka:kafka_2.11') {
testImplementation('org.apache.kafka:kafka_2.13') {
version {
strictly '2.3.1'
strictly '2.8.1'
}
}

Expand Down Expand Up @@ -129,7 +129,8 @@ subprojects {
testImplementation 'org.hamcrest:hamcrest-library:2.2'
testImplementation 'org.mockito:mockito-junit-jupiter:4.2.0'
testImplementation 'org.apache.curator:curator-test:2.8.0'
testImplementation 'io.netty:netty-all:4.1.72.Final'
implementation 'io.netty:netty-all:4.1.79.Final'
testImplementation 'io.netty:netty-all:4.1.79.Final'
testRuntimeOnly 'javax.servlet:javax.servlet-api:3.1.0'

implementation 'javax.validation:validation-api:2.0.1.Final'
Expand Down
4 changes: 0 additions & 4 deletions src-java/floodlight-service/floodlight-modules/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ dependencies {
testImplementation('org.projectfloodlight:floodlight')
testImplementation 'org.mockito:mockito-junit-jupiter'

implementation('org.apache.kafka:kafka_2.11') {
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'log4j', module: 'log4j'
}
implementation 'commons-codec:commons-codec'
implementation 'org.apache.commons:commons-collections4'
implementation 'com.auth0:java-jwt:3.2.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import org.openkilda.floodlight.service.session.SessionService;
import org.openkilda.model.SwitchId;

import edu.umd.cs.findbugs.annotations.NonNull;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
import net.floodlightcontroller.core.IOFSwitch;
import net.floodlightcontroller.core.internal.IOFSwitchService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import org.openkilda.wfm.topology.floodlightrouter.bolts.SpeakerToNetworkProxyBolt;
import org.openkilda.wfm.topology.floodlightrouter.bolts.SwitchMonitorBolt;

import joptsimple.internal.Strings;
import com.google.common.base.Strings;
import lombok.Value;
import org.apache.storm.generated.StormTopology;
import org.apache.storm.kafka.bolt.mapper.FieldNameBasedTupleToKafkaMapper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

package org.openkilda.wfm.topology.floodlightrouter;

import joptsimple.internal.Strings;
import com.google.common.base.Strings;
import lombok.extern.slf4j.Slf4j;
import org.apache.storm.kafka.bolt.selector.KafkaTopicSelector;
import org.apache.storm.tuple.Tuple;
Expand Down
20 changes: 5 additions & 15 deletions src-java/grpc-speaker/grpc-service/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.springframework.boot' version '2.2.13.RELEASE'
id 'org.springframework.boot' version '2.3.12.RELEASE'
}

configurations {
Expand All @@ -9,8 +9,8 @@ configurations {

description = 'GRPC service'
dependencies {
implementation(platform('org.springframework:spring-framework-bom:5.2.19.RELEASE'))
implementation(platform('org.springframework.boot:spring-boot-dependencies:2.2.13.RELEASE'))
implementation(platform('org.springframework:spring-framework-bom:5.2.22.RELEASE'))
implementation(platform('org.springframework.boot:spring-boot-dependencies:2.3.12.RELEASE'))

implementation project(':grpc-api')
implementation project(':kilda-configuration')
Expand All @@ -23,24 +23,14 @@ dependencies {
implementation 'org.springframework.security:spring-security-web'
implementation ('org.springframework.kafka:spring-kafka') {
version {
strictly '2.3.13.RELEASE'
strictly '2.6.13'
}
// This conflicts with kafka_2.11
exclude module:'kafka_2.12'
exclude group: 'org.apache.kafka', module: 'kafka-clients'
}
implementation('org.apache.kafka:kafka-clients') {
version {
strictly '2.3.1'
strictly '2.8.1'
}
}
implementation('org.apache.kafka:kafka_2.11') {
version {
strictly '2.3.1'
}
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'log4j', module: 'log4j'
}

implementation 'org.slf4j:slf4j-api'
implementation 'io.grpc:grpc-protobuf'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory;
import org.springframework.kafka.core.ConsumerFactory;
import org.springframework.kafka.core.DefaultKafkaConsumerFactory;
import org.springframework.kafka.support.serializer.ErrorHandlingDeserializer2;
import org.springframework.kafka.support.serializer.ErrorHandlingDeserializer;
import org.springframework.kafka.support.serializer.JsonDeserializer;

import java.util.Map;
Expand Down Expand Up @@ -128,7 +128,7 @@ public Map<String, Object> consumerConfigs() {
@Bean
public ConsumerFactory<String, CommandMessage> consumerFactory() {
return new DefaultKafkaConsumerFactory<>(consumerConfigs(),
new StringDeserializer(), new ErrorHandlingDeserializer2(
new StringDeserializer(), new ErrorHandlingDeserializer(
new JsonDeserializer<>(CommandMessage.class)));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ dependencies {
testRuntimeOnly 'org.glassfish:javax.el'
testRuntimeOnly 'org.apache.curator:curator-test'
testRuntimeOnly 'org.apache.logging.log4j:log4j-slf4j-impl'
testImplementation 'org.apache.kafka:kafka_2.13'

compileOnly 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
Expand Down
20 changes: 5 additions & 15 deletions src-java/northbound-service/northbound/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.springframework.boot' version '2.2.13.RELEASE'
id 'org.springframework.boot' version '2.3.12.RELEASE'
}

configurations {
Expand All @@ -9,8 +9,8 @@ configurations {

description = 'Northbound Service'
dependencies {
implementation(platform('org.springframework:spring-framework-bom:5.2.19.RELEASE'))
implementation(platform('org.springframework.boot:spring-boot-dependencies:2.2.13.RELEASE'))
implementation(platform('org.springframework:spring-framework-bom:5.2.22.RELEASE'))
implementation(platform('org.springframework.boot:spring-boot-dependencies:2.3.12.RELEASE'))

implementation project(':northbound-api')
implementation project(':flowhs-messaging')
Expand All @@ -34,25 +34,15 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-tomcat'
implementation ('org.springframework.kafka:spring-kafka') {
version {
strictly '2.3.13.RELEASE'
strictly '2.6.13'
}
// This conflicts with kafka_2.11
exclude module:'kafka_2.12'
exclude group: 'org.apache.kafka', module: 'kafka-clients'
}
implementation 'org.springframework:spring-webmvc'
implementation('org.apache.kafka:kafka-clients') {
version {
strictly '2.3.1'
strictly '2.8.1'
}
}
implementation('org.apache.kafka:kafka_2.11') {
version {
strictly '2.3.1'
}
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'log4j', module: 'log4j'
}
implementation 'org.apache.logging.log4j:log4j-api'
implementation 'org.apache.logging.log4j:log4j-core'
implementation 'org.apache.commons:commons-lang3'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory;
import org.springframework.kafka.core.ConsumerFactory;
import org.springframework.kafka.core.DefaultKafkaConsumerFactory;
import org.springframework.kafka.support.serializer.ErrorHandlingDeserializer2;
import org.springframework.kafka.support.serializer.ErrorHandlingDeserializer;
import org.springframework.kafka.support.serializer.JsonDeserializer;

import java.util.Map;
Expand Down Expand Up @@ -128,7 +128,7 @@ private Map<String, Object> consumerConfigs() {
@Bean
public ConsumerFactory<String, Message> consumerFactory(ObjectMapper objectMapper) {
return new DefaultKafkaConsumerFactory<>(consumerConfigs(),
new StringDeserializer(), new ErrorHandlingDeserializer2(
new StringDeserializer(), new ErrorHandlingDeserializer(
new JsonDeserializer<>(Message.class, objectMapper)));
}

Expand Down
6 changes: 3 additions & 3 deletions src-java/server42/server42-control-server-stub/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.springframework.boot' version '2.2.13.RELEASE'
id 'org.springframework.boot' version '2.3.12.RELEASE'
}

configurations {
Expand All @@ -8,8 +8,8 @@ configurations {
}

dependencies {
implementation(platform('org.springframework:spring-framework-bom:5.2.19.RELEASE'))
implementation(platform('org.springframework.boot:spring-boot-dependencies:2.2.13.RELEASE'))
implementation(platform('org.springframework:spring-framework-bom:5.2.22.RELEASE'))
implementation(platform('org.springframework.boot:spring-boot-dependencies:2.3.12.RELEASE'))

implementation project(':server42-control-messaging')
implementation project(':server42-stats-messaging')
Expand Down
21 changes: 7 additions & 14 deletions src-java/server42/server42-control-storm-stub/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.springframework.boot' version '2.2.13.RELEASE'
id 'org.springframework.boot' version '2.3.12.RELEASE'
}

configurations {
Expand All @@ -10,8 +10,8 @@ configurations {
description = 'server42-control-storm-stub'

dependencies {
implementation(platform('org.springframework:spring-framework-bom:5.2.19.RELEASE'))
implementation(platform('org.springframework.boot:spring-boot-dependencies:2.2.13.RELEASE'))
implementation(platform('org.springframework:spring-framework-bom:5.2.22.RELEASE'))
implementation(platform('org.springframework.boot:spring-boot-dependencies:2.3.12.RELEASE'))

implementation project(':server42-control-messaging')
implementation project(':server42-messaging')
Expand All @@ -34,25 +34,18 @@ dependencies {

implementation ('org.springframework.kafka:spring-kafka') {
version {
strictly '2.3.13.RELEASE'
strictly '2.6.13'
}
// This conflicts with kafka_2.11
exclude module:'kafka_2.12'
}
testImplementation ('org.springframework.kafka:spring-kafka-test') {
version {
strictly '2.3.13.RELEASE'
strictly '2.6.13'
}
// This conflicts with kafka_2.11
exclude module:'kafka_2.12'
}
implementation 'org.apache.kafka:kafka-clients'
implementation('org.apache.kafka:kafka_2.11') {
implementation('org.apache.kafka:kafka-clients') {
version {
strictly '2.3.1'
strictly '2.8.1'
}
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'log4j', module: 'log4j'
}

implementation 'org.mapstruct:mapstruct'
Expand Down
21 changes: 7 additions & 14 deletions src-java/server42/server42-control/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.springframework.boot' version '2.2.13.RELEASE'
id 'org.springframework.boot' version '2.3.12.RELEASE'
}

configurations {
Expand All @@ -9,8 +9,8 @@ configurations {

description = 'server42-control'
dependencies {
implementation(platform('org.springframework:spring-framework-bom:5.2.19.RELEASE'))
implementation(platform('org.springframework.boot:spring-boot-dependencies:2.2.13.RELEASE'))
implementation(platform('org.springframework:spring-framework-bom:5.2.22.RELEASE'))
implementation(platform('org.springframework.boot:spring-boot-dependencies:2.3.12.RELEASE'))

implementation project(':kilda-model')
implementation project(':blue-green')
Expand All @@ -37,25 +37,18 @@ dependencies {

implementation('org.springframework.kafka:spring-kafka') {
version {
strictly '2.3.13.RELEASE'
strictly '2.6.13'
}
// This conflicts with kafka_2.11
exclude module:'kafka_2.12'
}
testImplementation('org.springframework.kafka:spring-kafka-test') {
version {
strictly '2.3.13.RELEASE'
strictly '2.6.13'
}
// This conflicts with kafka_2.11
exclude module:'kafka_2.12'
}
implementation 'org.apache.kafka:kafka-clients'
implementation('org.apache.kafka:kafka_2.11') {
implementation('org.apache.kafka:kafka-clients') {
version {
strictly '2.3.1'
strictly '2.8.1'
}
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'log4j', module: 'log4j'
}

compileOnly 'org.projectlombok:lombok'
Expand Down
Loading

0 comments on commit 127d665

Please sign in to comment.