Skip to content

Commit 754cf60

Browse files
authored
Merge pull request #288 from lensesio-dev/chore/kafka-4.1
Upgrade to Kafka 4.1.0
2 parents 630b3d9 + c3c0823 commit 754cf60

File tree

79 files changed

+54
-7977
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+54
-7977
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ jobs:
191191
strategy:
192192
matrix:
193193
module: ${{fromJSON(needs.initiate.outputs.fun_matrix)}}
194-
connectImageVersion: [7.3.1, 6.2.2]
194+
connectImageVersion: [8.0.2, 8.1.0]
195195
steps:
196196
- uses: actions/checkout@v4
197197
- name: Set up JDK 17

.github/workflows/func-only.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
matrix:
1414
module: ["http"]
15-
connectImageVersion: [ 7.3.1, 6.2.2 ]
15+
connectImageVersion: [ 8.0.2, 8.1.0 ]
1616

1717
steps:
1818
- uses: actions/checkout@v4

build.sbt

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,9 @@ lazy val subProjects: Seq[Project] = Seq(
3535
ftp,
3636
`gcp-storage`,
3737
http,
38-
influxdb,
3938
jms,
4039
mongodb,
4140
mqtt,
42-
redis,
4341
)
4442

4543
lazy val subProjectsRefs: Seq[ProjectReference] = subProjects.map(projectToLocalProject)
@@ -399,27 +397,6 @@ lazy val http = (project in file("kafka-connect-http"))
399397
.configureFunctionalTests()
400398
.enablePlugins(PackPlugin, ProtocPlugin)
401399

402-
lazy val influxdb = (project in file("kafka-connect-influxdb"))
403-
.dependsOn(common)
404-
.dependsOn(`sql-common`)
405-
.settings(
406-
settings ++
407-
Seq(
408-
name := "kafka-connect-influxdb",
409-
description := "Kafka Connect compatible connectors to move data between Kafka and popular data stores",
410-
libraryDependencies ++= baseDeps ++ kafkaConnectInfluxDbDeps,
411-
publish / skip := true,
412-
packExcludeJars := Seq(
413-
"scala-.*\\.jar",
414-
"zookeeper-.*\\.jar",
415-
),
416-
),
417-
)
418-
.configureAssembly(true)
419-
.configureMavenDescriptor()
420-
.configureTests(baseTestDeps)
421-
.enablePlugins(PackPlugin)
422-
423400
lazy val jms = (project in file("kafka-connect-jms"))
424401
.dependsOn(common)
425402
.dependsOn(`sql-common`)
@@ -439,7 +416,7 @@ lazy val jms = (project in file("kafka-connect-jms"))
439416
Compile / PB.targets := Seq(
440417
PB.gens.java(Versions.googleProtobufVersion) -> (Test / sourceManaged).value,
441418
),
442-
Compile / PB.protocExecutable := file(Process("which protoc").!!.trim),
419+
Compile / PB.protocVersion := Versions.googleProtobufVersion,
443420
),
444421
)
445422
.configureAssembly(true)
@@ -520,31 +497,6 @@ lazy val mongodb = (project in file("kafka-connect-mongodb"))
520497
.configureFunctionalTests()
521498
.enablePlugins(PackPlugin)
522499

523-
lazy val redis = (project in file("kafka-connect-redis"))
524-
.dependsOn(common)
525-
.dependsOn(`sql-common`)
526-
.dependsOn(`test-common` % "fun->compile")
527-
.settings(
528-
settings ++
529-
Seq(
530-
name := "kafka-connect-redis",
531-
description := "Kafka Connect compatible connectors to move data between Kafka and popular data stores",
532-
libraryDependencies ++= baseDeps ++ kafkaConnectRedisDeps,
533-
publish / skip := true,
534-
FunctionalTest / baseDirectory := (LocalRootProject / baseDirectory).value,
535-
packExcludeJars := Seq(
536-
"scala-.*\\.jar",
537-
"zookeeper-.*\\.jar",
538-
),
539-
),
540-
)
541-
.configureAssembly(true)
542-
.configureMavenDescriptor()
543-
.configureTests(baseTestDeps ++ Seq(gson))
544-
.configureIntegrationTests(kafkaConnectRedisTestDeps)
545-
.configureFunctionalTests()
546-
.enablePlugins(PackPlugin)
547-
548500
lazy val `test-common` = (project in file("test-common"))
549501
.settings(
550502
settings ++

java-connectors/build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,19 @@ allprojects {
2828
apply plugin: 'com.diffplug.spotless'
2929

3030
java {
31-
setSourceCompatibility(JavaVersion.VERSION_11)
32-
setTargetCompatibility(JavaVersion.VERSION_11)
31+
// Use Java 17 to match Kafka 4.1.0+ artifacts which require JVM 17
32+
setSourceCompatibility(JavaVersion.VERSION_17)
33+
setTargetCompatibility(JavaVersion.VERSION_17)
3334
}
3435

3536
ext {
3637
//DEPENDENCY VERSIONS
3738
lombokVersion = '1.18.32'
38-
kafkaVersion = '3.9.1'
39+
kafkaVersion = '4.1.0'
3940
logbackVersion = '1.4.14'
4041
jUnitVersion = '5.9.1'
4142
mockitoJupiterVersion = '5.10.0'
42-
apacheToConfluentVersionAxis = ["2.8.1": "6.2.2", "3.3.0": "7.3.1"]
43+
apacheToConfluentVersionAxis = ["4.0.0": "8.0.2", "4.1.0": "8.1.0"]
4344
caffeineVersion = '3.1.8'
4445
cyclopsVersion = '10.4.1'
4546
bouncyCastleVersion = "1.78.1"

java-connectors/kcbq-connector/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ project(":kcbq-connector") {
1111
googleAuthVersion = '0.21.1'
1212
googleCloudVersion = '2.10.9'
1313
googleCloudStorageVersion = '1.113.4'
14-
googleProtobufVersion = '3.25.5'
14+
1515
jacksonVersion = '2.16.2'
1616
kafkaVersion = '2.6.3'
1717
kafkaScalaVersion = '2.12'

kafka-connect-aws-s3/src/it/scala/io/lenses/streamreactor/connect/aws/s3/source/S3SourceTaskTest.scala

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ import io.lenses.streamreactor.connect.cloud.common.config.FormatOptions
1616
import io.lenses.streamreactor.connect.cloud.common.model.location.CloudLocation
1717
import io.lenses.streamreactor.connect.cloud.common.model.location.CloudLocationValidator
1818
import io.lenses.streamreactor.connect.cloud.common.source.config.CloudSourceSettingsKeys
19+
import org.apache.kafka.common.MetricName
20+
import org.apache.kafka.common.metrics.MetricValueProvider
21+
import org.apache.kafka.common.metrics.PluginMetrics
22+
import org.apache.kafka.common.metrics.Sensor
1923
import org.apache.kafka.connect.source.SourceTaskContext
2024
import org.apache.kafka.connect.storage.OffsetStorageReader
2125
import org.scalatest.BeforeAndAfter
@@ -29,6 +33,11 @@ import org.scalatest.time.SpanSugar.convertIntToGrainOfTime
2933
import java.util
3034
import scala.jdk.CollectionConverters.ListHasAsScala
3135
import scala.jdk.CollectionConverters.MapHasAsJava
36+
import org.apache.kafka.common.metrics.Metrics
37+
import org.apache.kafka.common.metrics.MetricConfig
38+
import org.apache.kafka.common.utils.Time
39+
import org.apache.kafka.common.metrics.Sensor.RecordingLevel
40+
3241
object S3SourceTaskTest {
3342

3443
val formats = Table(
@@ -214,6 +223,33 @@ class S3SourceTaskTest
214223
val task = new S3SourceTask()
215224

216225
val context = new SourceTaskContext {
226+
override def pluginMetrics(): PluginMetrics = new PluginMetrics {
227+
private val metricConfig = new MetricConfig()
228+
private val metricsRegistry = new Metrics(metricConfig, Time.SYSTEM)
229+
private val parents: Array[Sensor] = Array.empty
230+
override def metricName(
231+
name: String,
232+
description: String,
233+
tags: util.LinkedHashMap[String, String],
234+
): MetricName =
235+
new MetricName(name, "s3-source-task-metrics", description, tags)
236+
237+
override def addMetric(metricName: MetricName, metricValueProvider: MetricValueProvider[_]): Unit = {}
238+
239+
override def removeMetric(metricName: MetricName): Unit = {}
240+
241+
override def addSensor(name: String): Sensor =
242+
metricsRegistry.sensor(
243+
name,
244+
metricConfig,
245+
Long.MaxValue,
246+
RecordingLevel.INFO,
247+
parents: _*,
248+
)
249+
250+
override def removeSensor(name: String): Unit =
251+
metricsRegistry.removeSensor(name)
252+
}
217253
override def configs(): util.Map[String, String] = Map.empty[String, String].asJava
218254

219255
override def offsetStorageReader(): OffsetStorageReader = new OffsetStorageReader {

kafka-connect-influxdb/src/main/resources/influx-ascii.txt

Lines changed: 0 additions & 19 deletions
This file was deleted.

kafka-connect-influxdb/src/main/resources/logback.xml

Lines changed: 0 additions & 28 deletions
This file was deleted.

kafka-connect-influxdb/src/main/scala/io/lenses/streamreactor/connect/influx/InfluxSinkConnector.scala

Lines changed: 0 additions & 71 deletions
This file was deleted.

0 commit comments

Comments
 (0)