@embedded kafka-使用构造函数创建主题与启用自动创建主题

brgchamk  于 2021-08-25  发布在  Java
关注(0)|答案(0)|浏览(250)

嗨,我在spring boot中使用@embeddedkafka进行集成测试。在使用以下两种方法创建主题时面临挑战。
在@embeddedkafka注解中使用topic属性
使用 auto.create.topic.enable=true 使用时 auto.create.topic.enable=true ,创建一个主题大约需要1.5分钟。

timeestamp=2021-07-07 22:39:08.443  app= tid= sid= psid= hostname= process=4243 thread=[Test worker] logger=c.t.f.m.MessagingConfiguration method=getObjectMapper line=143 ] | no bean 'messageConverter' found - No bean named 'messageConverter' available, using default mapper | 
[ timestamp=2021-07-07 22:40:42.584  app= tid= sid= psid= hostname= process=4243 thread=[data-plane-kafka-request-handler-6] logger=k.z.AdminZkClient method=info line=66 ] | Creating topic TOPIC_TEST with configuration {} and initial partition assignment Map(0 -> ArrayBuffer(0))

使用属性创建主题时,它工作正常

[ timestamp=2021-07-07 22:40:42.771  app= tid= sid= psid= hostname= process=4243 thread=[data-plane-kafka-request-handler-4] logger=k.c.Partition method=info line=66 ] | [Partition FULFILMENT_ORDER-0 broker=0] FULFILMENT_ORDER-0 starts at leader epoch 0 from offset 0 with high watermark 0. Previous leader epoch was -1. | 
[ timestamp=2021-07-07 22:42:13.362  app= tid= sid= psid= hostname= process=4243 thread=[data-plane-kafka-request-handler-4] logger=k.z.AdminZkClient method=info line=66 ] | Creating topic TOPIC_TEST with configuration {} and initial partition assignment Map(0 -> ArrayBuffer(0)) |

我想知道使用两种方法之间的区别是什么,为什么自动创建方法花费的时间太长????

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题