question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

It should be possible to set retention.bytes or retention.ms when creating a topic

See original GitHub issue

Hi @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:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
hekonsekcommented, Jun 26, 2017

OK. I will create a pull request and link it here.

Cheers!

0reactions
sobychackocommented, Oct 29, 2019

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 abnd replicaAssignments 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 replace consumer with producer. 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...

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found