79101314

Date: 2024-10-18 08:57:41
Score: 1.5
Natty:
Report link

Question 1: Is there a simpler way than to inject a Validator, validate every message, log the error and ignore the message for the processing in every listener?

Still could not find any.

Question 2: Is there a simpler way to make these conversion failures visible?

Created https://github.com/spring-projects/spring-kafka/issues/3555, but we will probably just handle the errors in the batch handler (extracted to a common helper).

Question 3: Is it possible to inject all headers in one argument instead of using one argument per header like shown on https://docs.spring.io/spring-kafka/reference/kafka/receiving-messages/listener-annotation.html#batch-listeners like we can for record listeners with ConsumerRecordMetadata? This would make it simpler to pass the payloads and headers to some helper method that we can use to perform all these checks, log errors and remove invalid messages.

Yes, we can inject @Headers Map<String, Object> headers with batch listeners as well.

Reasons:
  • Blacklisted phrase (1): Is it possible to
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: D. Schmidt