Micronaut Kafka is blocking

509 views Asked by At

after the first call to send a message on Kafka after starting the application is blocking on creating some 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

Any idea how to handle that. Application is blocking forever.

Regards Oliver

1

There are 1 answers

0
IEE1394 On BEST ANSWER

Found the reason. I was listening to rabbitmq messages using the consumer thread pool and write the stuff onto a kafka topic. For some reason that ends up with an race condition.

After using another dedicated thread pool for rabbitmq i called "messaging" everything works fine.