I am using spring-cloud-stream-binder-kafka and have implemented stateful retry using DefaultErrorHandler, I want to register different DefaultErrorHandler for different consumer consuming messages from different Kafka topics, and each DefaultErrorHandler will be pushing messages to dlq on recovery based on spring.cloud.stream.kafka.bindings.channel-in-0.consumer.dlqName configuration.
Now when I register a DefaultErrorHandler using ListenerContainerCustomizer I want to access KafkaConsumerProperties for the current input-channel and retrieve dlq name from it and use it in DefaultErrorHandler, so if I can get input-channel name I can get the consumer properties like
@Bean public ListenerContainerCustomizer<AbstractMessageListenerContainer> containerCustomizer() { return (container, dest, group) -> { KafkaConsumerProperties kafkaConsumerProperties = kafkaExtendedBindingProperties.getExtendedConsumerProperties("channel"); String dlqName = kafkaConsumerProperties.getDlqName(); DeadLetterPublishingRecoverer recoverer = new DeadLetterPublishingRecoverer(template, (rec, ex) -> new TopicPartition(dlqName, -1)); container.setCommonErrorHandler(new DefaultErrorHandler(recoverer,new FixedBackOff(2000L, 5L))); }; } Related questions 195 Why can I not create a wheel in python? 4 Kivy Color Wheel 0 kivy buildozer permission denied Related questions 195 Why can I not create a wheel in python? 4 Kivy Color Wheel 0 kivy buildozer permission denied 3 Issue with Kivy and Buildozer 1 Error installing kivy 2 Failed building wheel for 96 Could not build wheels since package wheel is not installed 4 ERROR: Could not build wheels for Kivy which use PEP 517 and cannot be installed directly 2 Kivy Issues with .py and .kv 1 How can I fix "Could not build wheels for scikit-image" error? Load 7 more related questions Show fewer related questions
Reset to default