{"id":18390779,"url":"https://github.com/eifinger/kafka-scheduler","last_synced_at":"2026-03-04T19:02:31.556Z","repository":{"id":96180946,"uuid":"330473892","full_name":"eifinger/kafka-scheduler","owner":"eifinger","description":"A scalable, distributed Kafka message scheduler with only a Kafka cluster as a dependency","archived":false,"fork":false,"pushed_at":"2023-01-29T16:32:20.000Z","size":335,"stargazers_count":3,"open_issues_count":3,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-24T08:22:56.611Z","etag":null,"topics":["apache-kafka","hacktoberfest","hacktoberfest2023","java","jobrunr","kafka"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eifinger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-17T19:52:18.000Z","updated_at":"2024-11-23T12:57:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"dbdb5680-bc30-4811-9454-cfe9f2fe449d","html_url":"https://github.com/eifinger/kafka-scheduler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eifinger%2Fkafka-scheduler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eifinger%2Fkafka-scheduler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eifinger%2Fkafka-scheduler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eifinger%2Fkafka-scheduler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eifinger","download_url":"https://codeload.github.com/eifinger/kafka-scheduler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239075078,"owners_count":19577298,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apache-kafka","hacktoberfest","hacktoberfest2023","java","jobrunr","kafka"],"created_at":"2024-11-06T01:49:07.708Z","updated_at":"2025-10-30T23:30:30.143Z","avatar_url":"https://github.com/eifinger.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kafka-scheduler\n\nA scalable, distributed Kafka message scheduler with only a Kafka cluster as a dependency.\n\n## Why?\n\nSome applications or microservices run without any database or external dependency\nonly sending and receiving messages through Kafka.\n\nIf they have to schedule some tasks for example\n\n* Send out a reminder email every day if a user has not verified their email\n* Generate an export every 30 minutes\n* ...\n\nthe application has to make sure that the task is executed exactly once.\nEven if the application moves to another node on a Kubernetes cluster.\n\nThe usual way to handle persistent jobs would be to use Quartz, Hangfire or Jobrunr.\nBut all of them depend on a database.\n\nWhy should I have to introduce a database into my stack if I can \"just\" stay with Kafka?\n\n## How?\n\nKafka-scheduler lets you schedule a Kafka message with a desired key, value and headers and\nwhen you want to receive them on which topic. This way your application receives the message\nas a trigger and can execute the business logic on the desired schedule.\n\n### OneTimeCommand\n\nA fire-and-forget command will be triggered at a certain point in the future.\n\n```mermaid\nsequenceDiagram\n    autonumber\n    note right of Application: Topic: one-time-commands\u003cbr\u003eHeaders\u003cbr\u003ekafka-scheduler-key: myKey\u003cbr\u003ekafka-scheduler-topic: mytopic\u003cbr\u003ekafka-scheduler-when:2011-12-03T10:15:30+01:00\n    Application-\u003e\u003eKafka-Scheduler: key:value\n    Kafka-Scheduler-\u003e\u003eKafka-Scheduler: Schedule\n    note right of Application: Topic: mytopic\n    Kafka-Scheduler-\u003e\u003eApplication: mykey:value\n```\n\n#### Headers\n\n|        Header         |                           Description                            |\n|:---------------------:|:----------------------------------------------------------------:|\n| kafka-scheduler-key   | The kafka message key used as a unique id so it can be cancelled |\n| kafka-scheduler-value |         The Kafka message value you want to receive back         |\n| kafka-scheduler-when  |                 A ISO-6801 configured Timestamp                  |\n\n#### Key and Value\n\n| Field |                           Description                            |\n|-------|:----------------------------------------------------------------:|\n| Key   | The kafka message key used as a unique id so it can be cancelled |\n| Value |         The Kafka message value you want to receive back         |\n\n### RecurringCommand\n\nA command which will be triggered on a CRON schedule\n\n```mermaid\nsequenceDiagram\n    autonumber\n    note right of Application: Topic: recurring-commands\u003cbr\u003eHeaders\u003cbr\u003ekafka-scheduler-key: myKey\u003cbr\u003ekafka-scheduler-topic: mytopic\u003cbr\u003ekafka-scheduler-cron: */5 * * * * *\n    Application-\u003e\u003eKafka-Scheduler: key:value\n    Kafka-Scheduler-\u003e\u003eKafka-Scheduler: Schedule\n    note right of Application: Topic: mytopic\n    Kafka-Scheduler-\u003e\u003eApplication: mykey:value\n    note right of Application: Topic: mytopic\n    Kafka-Scheduler-\u003e\u003eApplication: mykey:value\n    note right of Application: Topic: mytopic\n    Kafka-Scheduler-\u003e\u003eApplication: mykey:value\n```\n\n#### Headers\n\n|        Header         |                           Description                            |\n|:---------------------:|:----------------------------------------------------------------:|\n| kafka-scheduler-key   | The kafka message key used as a unique id so it can be cancelled |\n| kafka-scheduler-value |         The Kafka message value you want to receive back         |\n| kafka-scheduler-cron  |        A cron expression with extended syntax support]           |\n\n#### Key and Value\n\n| Field |                           Description                            |\n|-------|:----------------------------------------------------------------:|\n| Key   | The kafka message key used as a unique id so it can be cancelled |\n| Value |         The Kafka message value you want to receive back         |\n\n### FixedRateCommand\n\nA command which a defined duration between runs\n\n```mermaid\nsequenceDiagram\n    autonumber\n    note right of Application: Topic: fixed-rate-commands\u003cbr\u003eHeaders\u003cbr\u003ekafka-scheduler-key: myKey\u003cbr\u003ekafka-scheduler-topic: mytopic\u003cbr\u003ekafka-scheduler-period: PT5S\n    Application-\u003e\u003eKafka-Scheduler: key:value\n    Kafka-Scheduler-\u003e\u003eKafka-Scheduler: Schedule\n    note right of Application: Topic: mytopic\n    Kafka-Scheduler-\u003e\u003eApplication: mykey:value\n    note right of Application: Topic: mytopic\n    Kafka-Scheduler-\u003e\u003eApplication: mykey:value\n    note right of Application: Topic: mytopic\n    Kafka-Scheduler-\u003e\u003eApplication: mykey:value\n```\n\n#### Headers\n\n|         Header         |                           Description                            |\n|:----------------------:|:----------------------------------------------------------------:|\n| kafka-scheduler-key    | The kafka message key used as a unique id so it can be cancelled |\n| kafka-scheduler-value  |         The Kafka message value you want to receive back         |\n| kafka-scheduler-period |                       A ISO-8601 Duration                        |\n\n#### Key and Value\n\n| Field |                           Description                            |\n|-------|:----------------------------------------------------------------:|\n| Key   | The kafka message key used as a unique id so it can be cancelled |\n| Value |         The Kafka message value you want to receive back         |\n\n### Cancelling Commands\n\nAll commands can be cancelled by sending a Kafka tombstone message\nwith the same key which was used to schedule the command.\n\n```mermaid\nsequenceDiagram\n    autonumber\n    note right of Application: Topic: one-time-commands\u003cbr\u003eHeaders\u003cbr\u003ekafka-scheduler-key: myKey\u003cbr\u003ekafka-scheduler-topic: mytopic\u003cbr\u003ekafka-scheduler-when:2011-12-03T10:15:30+01:00\n    Application-\u003e\u003eKafka-Scheduler: key:value\n    Kafka-Scheduler-\u003e\u003eKafka-Scheduler: Schedule\n    note right of Application: Topic: one-time-commands\u003cbr\u003eHeaders\n    Application-\u003e\u003eKafka-Scheduler: key:null\n    Kafka-Scheduler-\u003e\u003eKafka-Scheduler: Cancel scheduled command\n```\n\n## Client SDK\n\nTBD\n\n## Detailed Documentation\n\nTBD\n\n# Other Kafka scheduler implementations\n\n[kafka-message-scheduler](https://github.com/etf1/kafka-message-scheduler) -\nAwesome implementation by [@etf](https://github.com/etf) in Go. Only supports OneTimeCommands but has\nmemory optimizations and an [Admin UI](https://github.com/etf1/kafka-message-scheduler-admin).\n\n[high-available-task-scheduling](https://github.com/cbenaveen/high-available-task-scheduling) -\nImplementation by [@cbenaveen](https://github.com/cbenaveen) using Kafka Streams.\n\n# Acknowledgements\n\n[@rdehuyss](https://github.com/rdehuyss) for creating [JobRunr](https://github.com/jobrunr/jobrunr)\nthe easiest to use scheduling library in the JVM space.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feifinger%2Fkafka-scheduler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feifinger%2Fkafka-scheduler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feifinger%2Fkafka-scheduler/lists"}