在启动应用程序后,第一次调用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$13(String, AnnotationMetadata, Argument, Argument, KafkaClientIntroductionAdvice$ProducerKey) KafkaClientIntroductionAdvice.java:586
io.micronaut.configuration.kafka.intercept.KafkaClientIntroductionAdvice$$Lambda$956.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
你知道怎么处理吗。应用程序永远被阻塞。
向奥利弗问好
1条答案
按热度按时间pgvzfuti1#
找到了原因。我正在使用使用者线程池收听rabbitmq消息,并将内容写入kafka主题。出于某种原因,这最终导致了一个竞赛条件。
在为rabbitmq使用了另一个专用的线程池之后,我称之为“消息传递”,一切正常。