Micronaut Kafka 正在阻塞

Micronaut Kafka is blocking

在启动应用程序后第一次调用在 Kafka 上发送消息后,阻塞了创建一些 bean AbstractKafkaProducerConfiguration

  io.micronaut.context.DefaultBeanContext.getBeanInternal(BeanResolutionContext, Class, Qualifier, boolean, boolean) DefaultBeanContext.java:2289
  io.micronaut.context.DefaultBeanContext.getBean(Class) DefaultBeanContext.java:733
  io.micronaut.configuration.kafka.intercept.KafkaClientIntroductionAdvice.lambda$getProducer(String, AnnotationMetadata, Argument, Argument, KafkaClientIntroductionAdvice$ProducerKey) KafkaClientIntroductionAdvice.java:586
  io.micronaut.configuration.kafka.intercept.KafkaClientIntroductionAdvice$$Lambda6.apply(Object)
  java.util.concurrent.ConcurrentHashMap.computeIfAbsent(Object, Function) ConcurrentHashMap.java:1705
  io.micronaut.configuration.kafka.intercept.KafkaClientIntroductionAdvice.getProducer(Argument, Argument, AnnotationMetadata) KafkaClientIntroductionAdvice.java:575
  io.micronaut.configuration.kafka.intercept.KafkaClientIntroductionAdvice.intercept(MethodInvocationContext) KafkaClientIntroductionAdvice.java:227
  io.micronaut.aop.chain.MethodInterceptorChain.proceed() MethodInterceptorChain.java:82
  io.micronaut.retry.intercept.RecoveryInterceptor.intercept(MethodInvocationContext) RecoveryInterceptor.java:92
  io.micronaut.aop.chain.MethodInterceptorChain.proceed() MethodInterceptorChain.java:82

知道如何处理它。应用程序永远阻塞。

问候 奥利弗

找到原因了。我正在使用消费者线程池收听 rabbitmq 消息,并将内容写入 kafka 主题。由于某种原因,最终出现了竞争条件。

在为 rabbitmq 使用另一个专用线程池后,我调用了“消息传递”,一切正常。