-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
When manually defining a bean RetryTopicConfiguration
with an includeTopic
, such as:
@KafkaListener(topics = "${kafka.topic}", groupId = "id")
public void listen(String message) {
}
@Bean
public RetryTopicConfiguration retryTopicConfiguration(KafkaTemplate<String, String> template) {
return RetryTopicConfigurationBuilder.newInstance()
.includeTopic("topic")
.create(template);
}
where kafka.topic
is a SPEL expression that resolves to topic
, reply and dead letter topics are not automatically created as they are not matched in AllowDenyCollectionManager
.
Diving a bit into the implementation, AllowDenyCollectionManager#areAllowed
will try to match the includeTopic
with the non-resolved SPEL expression ${kafka.topic}
.
Here's a sample application. By launching the tests or the application without .includeTopic("topic")
we see in the logs that the retry and dead letter topics are created, but adding .includeTopic("topic")
the logs are not shown.
demo 2.zip