It should be possible to set retention.bytes or retention.ms when creating a topic
See original GitHub issueHi @mbogoevici,
Currently there is no way to specify topic config to use when creating new topic. I think it would be awesome to have an ability to say something like…
spring.cloud.stream.kafka.topics.foo.retention.ms = 604800000
spring.cloud.stream.kafka.topics.foo.retention.bytes = 200000
…to indicate retention limits that should be applied by broker admin utility when creating new topic foo
.
It would be nice to support other topic config options as well in the future, but retention limits would be nice starting point IMHO as this is probably the most popular config option applied to new topics.
I can prepare a PR with such addition, but I just wanted to verify that this is something you find useful.
Thanks!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Kafka Topic Configurations for Confluent Platform
This config designates the retention policy to use on log segments. The “delete” policy (which is the default) will discard old segments when...
Read more >Kafka log.segment.bytes vs log.retention.hours - Stack Overflow
This means that if you have a topic with 8 partitions, and log.retention.bytes is set to 1 GB, the amount of data retained...
Read more >Kafka Topic Configuration: Log Retention - Conduktor
Advanced Kafka Topic tutorial about Kafka Topic Retention and deletion of old log segments based on retention time (kafka retention ms) or size....
Read more >how to set permanent kafka retention bytes on different topics
retention. bytes. To specify a retention time period per topic, use the following command. To specify a retention log size per topic, use...
Read more >Configuring Message Retention Period in Apache Kafka
We can notice here that the default retention time is seven days. To retain messages only for ten minutes, we can set the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
OK. I will create a pull request and link it here.
Cheers!
Topic level properties can be passed through the topic provisioner to admin using the binding level properties. If you have a binding named
input
and if its a consumer binding, then this is how you may use it.spring.cloud.stream.kafka.bindings.input.consumer.topic
.replicationFactor
abndreplicaAssignments
are supported by default. Any other properties need to use the following format.spring.cloud.stream.kafka.bindings.input.consumer.topic.properties.retention.ms
,spring.cloud.stream.kafka.bindings.input.consumer.topic.properties.max.message.bytes
etc.See this class for more details.
If you have a producer binding named
output
, then replaceconsumer
withproducer
. For e.g.spring.cloud.stream.kafka.bindings.output.producer.topic
.If you are using it as part of the Kafka Streams binder, then use the prefix
spring.cloud.stream.kafka.streams.bindings...