@@ -3,9 +3,9 @@ package io.github.embeddedkafka.ops
3
3
import io .github .embeddedkafka .{EmbeddedK , EmbeddedKafkaConfig , EmbeddedServer }
4
4
import kafka .server ._
5
5
import org .apache .kafka .common .Uuid
6
- import org .apache .kafka .common .security .auth .SecurityProtocol
7
6
import org .apache .kafka .common .utils .Time
8
7
import org .apache .kafka .coordinator .group .GroupCoordinatorConfig
8
+ import org .apache .kafka .coordinator .transaction .TransactionLogConfig
9
9
import org .apache .kafka .metadata .properties .{
10
10
MetaProperties ,
11
11
MetaPropertiesEnsemble ,
@@ -17,6 +17,7 @@ import org.apache.kafka.raft.QuorumConfig
17
17
import org .apache .kafka .server .ServerSocketFactory
18
18
import org .apache .kafka .server .config .{
19
19
KRaftConfigs ,
20
+ ReplicationConfigs ,
20
21
ServerConfigs ,
21
22
ServerLogConfigs
22
23
}
@@ -52,23 +53,26 @@ trait KafkaOps {
52
53
// Without this the controller starts correctly on a random port but it's too late to use this port in the configs for the broker
53
54
val actualControllerPort = findPortForControllerOrFail(controllerPort)
54
55
55
- val brokerListener = s " ${ SecurityProtocol . PLAINTEXT } ://localhost: $kafkaPort"
56
+ val brokerListener = s " BROKER ://localhost: $kafkaPort"
56
57
val controllerListener = s " CONTROLLER://localhost: $actualControllerPort"
57
58
58
59
val configProperties = Map [String , Object ](
59
- KRaftConfigs .PROCESS_ROLES_CONFIG -> " broker,controller" ,
60
- KRaftConfigs .NODE_ID_CONFIG -> nodeId.toString,
61
- KRaftConfigs .CONTROLLER_LISTENER_NAMES_CONFIG -> " CONTROLLER" ,
60
+ KRaftConfigs .PROCESS_ROLES_CONFIG -> " broker,controller" ,
61
+ KRaftConfigs .NODE_ID_CONFIG -> nodeId.toString,
62
+ ReplicationConfigs .INTER_BROKER_LISTENER_NAME_CONFIG -> " BROKER" ,
63
+ KRaftConfigs .CONTROLLER_LISTENER_NAMES_CONFIG -> " CONTROLLER" ,
62
64
QuorumConfig .QUORUM_VOTERS_CONFIG -> s " $nodeId@localhost: $actualControllerPort" ,
63
65
ServerConfigs .BROKER_ID_CONFIG -> nodeId.toString,
64
66
SocketServerConfigs .LISTENERS_CONFIG -> s " $brokerListener, $controllerListener" ,
65
67
SocketServerConfigs .ADVERTISED_LISTENERS_CONFIG -> brokerListener,
66
- SocketServerConfigs .LISTENER_SECURITY_PROTOCOL_MAP_CONFIG -> " CONTROLLER :PLAINTEXT,PLAINTEXT :PLAINTEXT,SSL:SSL,SASL_PLAINTEXT:SASL_PLAINTEXT,SASL_SSL:SASL_SSL " ,
68
+ SocketServerConfigs .LISTENER_SECURITY_PROTOCOL_MAP_CONFIG -> " BROKER :PLAINTEXT,CONTROLLER :PLAINTEXT" ,
67
69
ServerLogConfigs .AUTO_CREATE_TOPICS_ENABLE_CONFIG -> autoCreateTopics.toString,
68
70
ServerLogConfigs .LOG_DIRS_CONFIG -> kafkaLogDir.toAbsolutePath.toString,
69
71
ServerLogConfigs .LOG_FLUSH_INTERVAL_MESSAGES_CONFIG -> 1 .toString,
70
72
GroupCoordinatorConfig .OFFSETS_TOPIC_REPLICATION_FACTOR_CONFIG -> 1 .toString,
71
73
GroupCoordinatorConfig .OFFSETS_TOPIC_PARTITIONS_CONFIG -> 1 .toString,
74
+ TransactionLogConfig .TRANSACTIONS_TOPIC_REPLICATION_FACTOR_CONFIG -> 1 .toString,
75
+ TransactionLogConfig .TRANSACTIONS_TOPIC_MIN_ISR_CONFIG -> 1 .toString,
72
76
// The total memory used for log deduplication across all cleaner threads, keep it small to not exhaust suite memory
73
77
CleanerConfig .LOG_CLEANER_DEDUPE_BUFFER_SIZE_PROP -> logCleanerDedupeBufferSize.toString
74
78
) ++ customBrokerProperties
0 commit comments