Relative Content

Tag Archive for spring-bootspring-kafka

Spring Kafka JsonMessageConverter throws UnsupportedOperationException when sending messages

@Configuration public class Config { @Bean public RecordMessageConverter converter() { return new JsonMessageConverter(); } @Bean public BatchMessagingMessageConverter batchConverter() { return new BatchMessagingMessageConverter(converter()); } } @Component @RequiredArgsConstructor public class CancelAuthorizationLinkageListener { private final KafkaTemplate<String, CancelAuthorizationLinkage> kafkaTemplate; @KafkaListener( id = “${spring.kafka.listener.cancel-auth-linkage.id}”, topics = “${spring.kafka.listener.cancel-auth-linkage.topic.linkage}”, autoStartup = “false”, batch = “true”, groupId = “cushion”) public void listen(List<Message<CancelAuthorizationLinkage>> messages) […]

Customized DeadLetterPublishingRecoverer not being invoked

We are upgrading from Spring Boot 2 / spring-kafka 2.8.4 to Spring Boot 3 / spring-kafka 3.1.2 And have had to transition from SeekToCurrentErrorHandler to CommonErrorHandler. Our original attempt at this was to replace the method that created the SeekToCurrentErrorHandler with a method that created a DefaultErrorHandler that calls the constructor that takes a ConsumerRecordRecoverer and a BackOff. The BiFunction of the ConsumerRecordRecoverer never is invoked.