如何创建多个 EmbeddedKafka,现在我在 EmbeddedKafka 上定义了两个主题。
@EmbeddedKafka(
partitions = 1,
topics = [Constants.TEST_TOPIC_one, Constants.TEST_TOPIC_two],
controlledShutdown = false,
brokerProperties = [
"offsets.topic.replication.factor=1",
"transaction.state.log.replication.factor=1",
"transaction.state.log.min.isr=1"
]
)
but i need to have two instance like below,
@EmbeddedKafka(
partitions = 1,
topics = [Constants.TEST_TOPIC_one],
controlledShutdown = false,
brokerProperties = [
**"offsets.topic.replication.factor=1",
"transaction.state.log.replication.factor=1",
"transaction.state.log.min.isr=1"**
]
)
@EmbeddedKafka(
partitions = 1,
topics = [Constants.TEST_TOPIC_two],
controlledShutdown = false,
brokerProperties = [
**"offsets.topic.replication.factor=2",**
"transaction.state.log.replication.factor=1",
"transaction.state.log.min.isr=1"
]
)
在上面的块中,我将更改 replication.factor