Skip to content
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

SKYEDEN-3234 detect unused topics #1922

Open
wants to merge 36 commits into
base: master
Choose a base branch
from

Conversation

questras
Copy link
Collaborator

@questras questras commented Nov 12, 2024

  • Add a cron job to detect inactive topics and notify them
  • notification thresholds, cron etc are configured via properties
  • Notifier implementation is not provided, but the feature can work without it
  • the job runs on one instance of hermes management only, based on provided ZK datacenter for leadership election (in properties)

@questras questras marked this pull request as ready for review November 14, 2024 16:53
moscicky
moscicky previously approved these changes Nov 19, 2024
Copy link
Collaborator

@moscicky moscicky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, really clean solution and tests

public record InactiveTopic(
@JsonProperty String qualifiedTopicName,
@JsonProperty long lastPublishedMessageTimestampMs,
@JsonProperty List<Long> notificationTimestampsMs,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if it is necessary to keep all notification history as it can grow indefinitely. Perhaps we can persist only previous notification time? what do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was my first thought but I decided to keep a list as it also tells you how many times you've already notified the topic, which might be useful.
What do you think about providing a configurable limit (via properties) of the list size? this way you still keep the history but it doesn't grow indefinitely

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, we can go with bounded list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants