3

I am currently trying to implement a consumer for kafka messages based on the openliberty mpReactiveMessaging feature: https://openliberty.io/blog/2019/09/13/microprofile-reactive-messaging.html

Given a method like:

@Incoming("greetings")
public CompletionStage <Void> consume(Message<String> greeting ){
   throw new RuntimeException("Something really bad happened.");
}

How can I implement error handling for these kinds of exceptions? The default behaviour is that the consumer stops to process messages on the first exception which is not quite what will lead to a stable/reliable implementation.

For https://kafka.apache.org/documentation/#sinkconnectconfigs there are properties to configure a deadletterqueue:

  • errors.tolerance
  • errors.deadletterqueue.topic.name

But these are not available for consumers: https://kafka.apache.org/documentation/#consumerconfigs Is there any way to get somehting like this working in openliberty using reactive messaging?

Andy Guibert
  • 41,446
  • 8
  • 38
  • 61

0 Answers0