Skip to content

Commit 18d6819

Browse files
committed
Create spring-boot-kafka module
1 parent 12752dd commit 18d6819

File tree

38 files changed

+327
-303
lines changed

38 files changed

+327
-303
lines changed

settings.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ include "spring-boot-project:spring-boot-jdbc"
6060
include "spring-boot-project:spring-boot-jetty"
6161
include "spring-boot-project:spring-boot-jms"
6262
include "spring-boot-project:spring-boot-jsonb"
63+
include "spring-boot-project:spring-boot-kafka"
6364
include "spring-boot-project:spring-boot-liquibase"
6465
include "spring-boot-project:spring-boot-mail"
6566
include "spring-boot-project:spring-boot-parent"

spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ dependencies {
2626
optional(project(":spring-boot-project:spring-boot-jdbc"))
2727
optional(project(":spring-boot-project:spring-boot-jetty"))
2828
optional(project(":spring-boot-project:spring-boot-jsonb"))
29+
optional(project(":spring-boot-project:spring-boot-kafka"))
2930
optional(project(":spring-boot-project:spring-boot-liquibase"))
3031
optional(project(":spring-boot-project:spring-boot-mail"))
3132
optional(project(":spring-boot-project:spring-boot-reactor-netty"))

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/KafkaMetricsAutoConfiguration.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323
import org.springframework.boot.autoconfigure.AutoConfiguration;
2424
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
2525
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
26-
import org.springframework.boot.autoconfigure.kafka.DefaultKafkaConsumerFactoryCustomizer;
27-
import org.springframework.boot.autoconfigure.kafka.DefaultKafkaProducerFactoryCustomizer;
28-
import org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration;
29-
import org.springframework.boot.autoconfigure.kafka.StreamsBuilderFactoryBeanCustomizer;
26+
import org.springframework.boot.kafka.autoconfigure.DefaultKafkaConsumerFactoryCustomizer;
27+
import org.springframework.boot.kafka.autoconfigure.DefaultKafkaProducerFactoryCustomizer;
28+
import org.springframework.boot.kafka.autoconfigure.StreamsBuilderFactoryBeanCustomizer;
3029
import org.springframework.context.annotation.Bean;
3130
import org.springframework.context.annotation.Configuration;
3231
import org.springframework.kafka.config.StreamsBuilderFactoryBean;
@@ -45,7 +44,7 @@
4544
* @author Eddú Meléndez
4645
* @since 2.1.0
4746
*/
48-
@AutoConfiguration(before = KafkaAutoConfiguration.class,
47+
@AutoConfiguration(beforeName = "org.springframework.boot.kafka.autoconfigure.KafkaAutoConfiguration",
4948
after = { MetricsAutoConfiguration.class, CompositeMeterRegistryAutoConfiguration.class })
5049
@ConditionalOnClass({ KafkaClientMetrics.class, ProducerFactory.class })
5150
@ConditionalOnBean(MeterRegistry.class)

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/KafkaMetricsAutoConfigurationTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
import org.springframework.boot.actuate.autoconfigure.metrics.test.MetricsRun;
2828
import org.springframework.boot.autoconfigure.AutoConfigurations;
29-
import org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration;
29+
import org.springframework.boot.kafka.autoconfigure.KafkaAutoConfiguration;
3030
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
3131
import org.springframework.context.annotation.Bean;
3232
import org.springframework.context.annotation.Configuration;

spring-boot-project/spring-boot-autoconfigure-all/build.gradle

-5
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ dependencies {
9797
}
9898
optional("org.apache.httpcomponents.client5:httpclient5")
9999
optional("org.apache.httpcomponents.core5:httpcore5-reactive")
100-
optional("org.apache.kafka:kafka-streams")
101100
optional("org.apache.tomcat.embed:tomcat-embed-core")
102101
optional("org.apache.tomcat.embed:tomcat-embed-el")
103102
optional("org.apache.tomcat.embed:tomcat-embed-websocket")
@@ -221,7 +220,6 @@ dependencies {
221220
optional("org.springframework.session:spring-session-jdbc")
222221
optional("org.springframework.amqp:spring-rabbit")
223222
optional("org.springframework.amqp:spring-rabbit-stream")
224-
optional("org.springframework.kafka:spring-kafka")
225223
optional("org.springframework.ws:spring-ws-core") {
226224
exclude group: "com.sun.mail", module: "jakarta.mail"
227225
exclude group: "jakarta.platform", module: "jakarta.jakartaee-api"
@@ -262,9 +260,6 @@ dependencies {
262260
testImplementation("org.postgresql:postgresql")
263261
testImplementation("org.postgresql:r2dbc-postgresql")
264262
testImplementation("org.springframework.graphql:spring-graphql-test")
265-
testImplementation("org.springframework.kafka:spring-kafka-test") {
266-
exclude group: "commons-logging", module: "commons-logging"
267-
}
268263
testImplementation("org.springframework.pulsar:spring-pulsar-cache-provider-caffeine")
269264
testImplementation("org.springframework.security:spring-security-test")
270265
testImplementation("org.yaml:snakeyaml")

spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json

-241
Original file line numberDiff line numberDiff line change
@@ -1017,177 +1017,6 @@
10171017
"reason": "Narayana support has moved to third party starter."
10181018
}
10191019
},
1020-
{
1021-
"name": "spring.kafka.admin.ssl.keystore-location",
1022-
"type": "org.springframework.core.io.Resource",
1023-
"description": "Location of the key store file.",
1024-
"deprecation": {
1025-
"replacement": "spring.kafka.admin.ssl.key-store-location",
1026-
"level": "error"
1027-
}
1028-
},
1029-
{
1030-
"name": "spring.kafka.admin.ssl.keystore-password",
1031-
"type": "java.lang.String",
1032-
"description": "Store password for the key store file.",
1033-
"deprecation": {
1034-
"replacement": "spring.kafka.admin.ssl.key-store-password",
1035-
"level": "error"
1036-
}
1037-
},
1038-
{
1039-
"name": "spring.kafka.admin.ssl.truststore-location",
1040-
"type": "org.springframework.core.io.Resource",
1041-
"description": "Location of the trust store file.",
1042-
"deprecation": {
1043-
"replacement": "spring.kafka.admin.ssl.trust-store-location",
1044-
"level": "error"
1045-
}
1046-
},
1047-
{
1048-
"name": "spring.kafka.admin.ssl.truststore-password",
1049-
"type": "java.lang.String",
1050-
"description": "Store password for the trust store file.",
1051-
"deprecation": {
1052-
"replacement": "spring.kafka.admin.ssl.trust-store-password",
1053-
"level": "error"
1054-
}
1055-
},
1056-
{
1057-
"name": "spring.kafka.consumer.ssl.keystore-location",
1058-
"type": "org.springframework.core.io.Resource",
1059-
"description": "Location of the key store file.",
1060-
"deprecation": {
1061-
"replacement": "spring.kafka.consumer.ssl.key-store-location",
1062-
"level": "error"
1063-
}
1064-
},
1065-
{
1066-
"name": "spring.kafka.consumer.ssl.keystore-password",
1067-
"type": "java.lang.String",
1068-
"description": "Store password for the key store file.",
1069-
"deprecation": {
1070-
"replacement": "spring.kafka.consumer.ssl.key-store-password",
1071-
"level": "error"
1072-
}
1073-
},
1074-
{
1075-
"name": "spring.kafka.consumer.ssl.truststore-location",
1076-
"type": "org.springframework.core.io.Resource",
1077-
"description": "Location of the trust store file.",
1078-
"deprecation": {
1079-
"replacement": "spring.kafka.consumer.ssl.trust-store-location",
1080-
"level": "error"
1081-
}
1082-
},
1083-
{
1084-
"name": "spring.kafka.consumer.ssl.truststore-password",
1085-
"type": "java.lang.String",
1086-
"description": "Store password for the trust store file.",
1087-
"deprecation": {
1088-
"replacement": "spring.kafka.consumer.ssl.trust-store-password",
1089-
"level": "error"
1090-
}
1091-
},
1092-
{
1093-
"name": "spring.kafka.listener.only-log-record-metadata",
1094-
"type": "java.lang.Boolean",
1095-
"defaultValue": true,
1096-
"description": "Whether to suppress the entire record from being written to the log when retries are being attempted.",
1097-
"deprecation": {
1098-
"reason": "Use KafkaUtils#setConsumerRecordFormatter instead.",
1099-
"level": "error"
1100-
}
1101-
},
1102-
{
1103-
"name": "spring.kafka.producer.ssl.keystore-location",
1104-
"type": "org.springframework.core.io.Resource",
1105-
"description": "Location of the key store file.",
1106-
"deprecation": {
1107-
"replacement": "spring.kafka.producer.ssl.key-store-location",
1108-
"level": "error"
1109-
}
1110-
},
1111-
{
1112-
"name": "spring.kafka.producer.ssl.keystore-password",
1113-
"type": "java.lang.String",
1114-
"description": "Store password for the key store file.",
1115-
"deprecation": {
1116-
"replacement": "spring.kafka.producer.ssl.key-store-password",
1117-
"level": "error"
1118-
}
1119-
},
1120-
{
1121-
"name": "spring.kafka.producer.ssl.truststore-location",
1122-
"type": "org.springframework.core.io.Resource",
1123-
"description": "Location of the trust store file.",
1124-
"deprecation": {
1125-
"replacement": "spring.kafka.producer.ssl.trust-store-location",
1126-
"level": "error"
1127-
}
1128-
},
1129-
{
1130-
"name": "spring.kafka.producer.ssl.truststore-password",
1131-
"type": "java.lang.String",
1132-
"description": "Store password for the trust store file.",
1133-
"deprecation": {
1134-
"replacement": "spring.kafka.producer.ssl.trust-store-password",
1135-
"level": "error"
1136-
}
1137-
},
1138-
{
1139-
"name": "spring.kafka.ssl.keystore-location",
1140-
"type": "org.springframework.core.io.Resource",
1141-
"description": "Location of the key store file.",
1142-
"deprecation": {
1143-
"replacement": "spring.kafka.ssl.key-store-location",
1144-
"level": "error"
1145-
}
1146-
},
1147-
{
1148-
"name": "spring.kafka.ssl.keystore-password",
1149-
"type": "java.lang.String",
1150-
"description": "Store password for the key store file.",
1151-
"deprecation": {
1152-
"replacement": "spring.kafka.ssl.key-store-password",
1153-
"level": "error"
1154-
}
1155-
},
1156-
{
1157-
"name": "spring.kafka.ssl.truststore-location",
1158-
"type": "org.springframework.core.io.Resource",
1159-
"description": "Location of the trust store file.",
1160-
"deprecation": {
1161-
"replacement": "spring.kafka.ssl.trust-store-location",
1162-
"level": "error"
1163-
}
1164-
},
1165-
{
1166-
"name": "spring.kafka.ssl.truststore-password",
1167-
"type": "java.lang.String",
1168-
"description": "Store password for the trust store file.",
1169-
"deprecation": {
1170-
"replacement": "spring.kafka.ssl.trust-store-password",
1171-
"level": "error"
1172-
}
1173-
},
1174-
{
1175-
"name": "spring.kafka.streams.cache-max-bytes-buffering",
1176-
"type": "java.lang.Integer",
1177-
"deprecation": {
1178-
"replacement": "spring.kafka.streams.state-store-cache-max-size",
1179-
"level": "error"
1180-
}
1181-
},
1182-
{
1183-
"name": "spring.kafka.streams.cache-max-size-buffering",
1184-
"type": "java.lang.Integer",
1185-
"deprecation": {
1186-
"replacement": "spring.kafka.streams.state-store-cache-max-size",
1187-
"level": "error",
1188-
"since": "3.1.0"
1189-
}
1190-
},
11911020
{
11921021
"name": "spring.mustache.prefix",
11931022
"defaultValue": "classpath:/templates/"
@@ -2180,76 +2009,6 @@
21802009
}
21812010
]
21822011
},
2183-
{
2184-
"name": "spring.kafka.consumer.auto-offset-reset",
2185-
"values": [
2186-
{
2187-
"value": "earliest",
2188-
"description": "Automatically reset the offset to the earliest offset."
2189-
},
2190-
{
2191-
"value": "latest",
2192-
"description": "Automatically reset the offset to the latest offset."
2193-
},
2194-
{
2195-
"value": "none",
2196-
"description": "Throw exception to the consumer if no previous offset is found for the consumer's group."
2197-
},
2198-
{
2199-
"value": "exception",
2200-
"description": "Throw exception to the consumer."
2201-
}
2202-
],
2203-
"providers": [
2204-
{
2205-
"name": "any"
2206-
}
2207-
]
2208-
},
2209-
{
2210-
"name": "spring.kafka.consumer.key-deserializer",
2211-
"providers": [
2212-
{
2213-
"name": "handle-as",
2214-
"parameters": {
2215-
"target": "org.apache.kafka.common.serialization.Deserializer"
2216-
}
2217-
}
2218-
]
2219-
},
2220-
{
2221-
"name": "spring.kafka.consumer.value-deserializer",
2222-
"providers": [
2223-
{
2224-
"name": "handle-as",
2225-
"parameters": {
2226-
"target": "org.apache.kafka.common.serialization.Deserializer"
2227-
}
2228-
}
2229-
]
2230-
},
2231-
{
2232-
"name": "spring.kafka.producer.key-serializer",
2233-
"providers": [
2234-
{
2235-
"name": "handle-as",
2236-
"parameters": {
2237-
"target": "org.apache.kafka.common.serialization.Serializer"
2238-
}
2239-
}
2240-
]
2241-
},
2242-
{
2243-
"name": "spring.kafka.producer.value-serializer",
2244-
"providers": [
2245-
{
2246-
"name": "handle-as",
2247-
"parameters": {
2248-
"target": "org.apache.kafka.common.serialization.Serializer"
2249-
}
2250-
}
2251-
]
2252-
},
22532012
{
22542013
"name": "spring.liquibase.change-log",
22552014
"providers": [

spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration
5555
org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration
5656
org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration
5757
org.springframework.boot.autoconfigure.jooq.JooqAutoConfiguration
58-
org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration
5958
org.springframework.boot.autoconfigure.ldap.embedded.EmbeddedLdapAutoConfiguration
6059
org.springframework.boot.autoconfigure.ldap.LdapAutoConfiguration
6160
org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration

spring-boot-project/spring-boot-dependencies/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -2040,6 +2040,7 @@ bom {
20402040
"spring-boot-jetty",
20412041
"spring-boot-jms",
20422042
"spring-boot-jsonb",
2043+
"spring-boot-kafka",
20432044
"spring-boot-liquibase",
20442045
"spring-boot-loader",
20452046
"spring-boot-loader-classic",

spring-boot-project/spring-boot-docs/build.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ dependencies {
6565
autoConfiguration(project(path: ":spring-boot-project:spring-boot-jetty", configuration: "autoConfigurationMetadata"))
6666
autoConfiguration(project(path: ":spring-boot-project:spring-boot-jms", configuration: "autoConfigurationMetadata"))
6767
autoConfiguration(project(path: ":spring-boot-project:spring-boot-jsonb", configuration: "autoConfigurationMetadata"))
68+
autoConfiguration(project(path: ":spring-boot-project:spring-boot-kafka", configuration: "autoConfigurationMetadata"))
6869
autoConfiguration(project(path: ":spring-boot-project:spring-boot-liquibase", configuration: "autoConfigurationMetadata"))
6970
autoConfiguration(project(path: ":spring-boot-project:spring-boot-mail", configuration: "autoConfigurationMetadata"))
7071
autoConfiguration(project(path: ":spring-boot-project:spring-boot-reactor-netty", configuration: "autoConfigurationMetadata"))
@@ -91,6 +92,7 @@ dependencies {
9192
configurationProperties(project(path: ":spring-boot-project:spring-boot-jdbc", configuration: "configurationPropertiesMetadata"))
9293
configurationProperties(project(path: ":spring-boot-project:spring-boot-jetty", configuration: "configurationPropertiesMetadata"))
9394
configurationProperties(project(path: ":spring-boot-project:spring-boot-jms", configuration: "configurationPropertiesMetadata"))
95+
configurationProperties(project(path: ":spring-boot-project:spring-boot-kafka", configuration: "configurationPropertiesMetadata"))
9496
configurationProperties(project(path: ":spring-boot-project:spring-boot-liquibase", configuration: "configurationPropertiesMetadata"))
9597
configurationProperties(project(path: ":spring-boot-project:spring-boot-mail", configuration: "configurationPropertiesMetadata"))
9698
configurationProperties(project(path: ":spring-boot-project:spring-boot-reactor-netty", configuration: "configurationPropertiesMetadata"))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
plugins {
2+
id "java-library"
3+
id "org.springframework.boot.auto-configuration"
4+
id "org.springframework.boot.configuration-properties"
5+
id "org.springframework.boot.deployed"
6+
id "org.springframework.boot.optional-dependencies"
7+
}
8+
9+
description = "Spring Boot Kafka"
10+
11+
dependencies {
12+
api(project(":spring-boot-project:spring-boot"))
13+
api("org.springframework.kafka:spring-kafka")
14+
15+
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
16+
optional("org.apache.kafka:kafka-streams")
17+
18+
testImplementation(project(":spring-boot-project:spring-boot-test"))
19+
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
20+
testImplementation("org.springframework.kafka:spring-kafka-test") {
21+
exclude group: "commons-logging", module: "commons-logging"
22+
}
23+
24+
testRuntimeOnly("ch.qos.logback:logback-classic")
25+
}

0 commit comments

Comments
 (0)