-
Notifications
You must be signed in to change notification settings - Fork 29
bulker: Add configurable retention time for retry topic #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -196,10 +196,16 @@ e.g. if `BULKER_KAFKA_TOPIC_PREFIX=some.prefix.`, then a full topic name could b | |||
|
|||
### `BULKER_KAFKA_TOPIC_RETENTION_HOURS` | |||
|
|||
*Optional, default value: `168` (7 days)* | |||
*Optional, default value: `48` (2 days)* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bulker/kafkabase/kafka_config.go
Line 25 in c0fb023
KafkaTopicRetentionHours int `mapstructure:"KAFKA_TOPIC_RETENTION_HOURS" default:"48"` |
|
||
Main topic retention time in hours. | ||
|
||
### `BULKER_KAFKA_TOPIC_SEGMENT_HOURS` | ||
|
||
*Optional, default value: `24` (1 day)* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bulker/kafkabase/kafka_config.go
Line 26 in c0fb023
KafkaTopicSegmentHours int `mapstructure:"KAFKA_TOPIC_SEGMENT_HOURS" default:"24"` |
kafkabase/kafka_config.go
Outdated
@@ -28,6 +28,7 @@ type KafkaConfig struct { | |||
KafkaFetchMessageMaxBytes int `mapstructure:"KAFKA_FETCH_MESSAGE_MAX_BYTES" default:"1048576"` | |||
|
|||
KafkaRetryTopicSegmentBytes int `mapstructure:"KAFKA_RETRY_TOPIC_SEGMENT_BYTES" default:"104857600"` | |||
KafkaRetryTopicRetentionHours int `mapstructure:"KAFKA_RETRY_TOPIC_RETENTION_HOURS" default:"168"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 203 to 207 in c0fb023
### `BULKER_KAFKA_RETRY_TOPIC_RETENTION_HOURS` | |
*Optional, default value: `168` (7 days)* | |
Topic for retried events retention time in hours. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Actually 7 days is too high value for that. When doing retries, retry consumer re-produces messages that are not ready yet. There is no point of having that retention higher than KafkaTopicRetentionHours
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, I used the default value from the docs. What value would you recommend for this? Should we set it to match the KafkaTopicRetentionHours
value (2 days)?"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 days is ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, I've updated the default value to 2 days.
1ac144e
to
cac1100
Compare
Overview
This PR includes the following updates related to Kafka env variables:
BULKER_KAFKA_TOPIC_SEGMENT_HOURS
- added a description for the environment variable in the documentation to clarify its purpose and default value (24h).BULKER_KAFKA_TOPIC_RETENTION_HOURS
in the documentation - fixed the default value for the environment variable to reflect the actual setting.KAFKA_RETRY_TOPIC_RETENTION_HOURS
- updated the code to properly use the environment variable, which was documented but not used in the code.