Distinct concurrency for retry and DLT topic containers #2434
-
I am struggling to understand how to achieve a configuration where I can have the listener container for the retry and DLT topics with a concurrency different from the container of the main topic (the retry and DLT topics do not need the same amount of threads/consumers). I have two beans of
Then, I already tried to force the use of the second factory for the retry/DTL containers with these 2 ways:
But in the end, I always end up having, for the retry and DLT topic, an amount of containers/threads equal to the concurrency of the main listener (that is, the concurrency declared in the I tried to understand and debug |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Here is a work around, until we can address this: @SpringBootApplication
public class Kgh2434Application {
public static void main(String[] args) {
SpringApplication.run(Kgh2434Application.class, args);
}
@KafkaListener(id = "kgh2434", topics = "kgh2434", concurrency = "1", autoStartup = "false")
@RetryableTopic
void listen(String in) {
System.out.println(in);
}
@Bean
ApplicationRunner runner(KafkaListenerEndpointRegistry registry) {
return args -> {
((ConcurrentMessageListenerContainer<?, ?>) registry.getListenerContainer("kgh2434")).setConcurrency(6);
registry.start();
};
}
} |
Beta Was this translation helpful? Give feedback.
Here is a work around, until we can address this: