{"id":15196878,"url":"https://github.com/sonus21/rqueue","last_synced_at":"2025-05-15T18:04:04.928Z","repository":{"id":44382210,"uuid":"216000802","full_name":"sonus21/rqueue","owner":"sonus21","description":"Rqueue aka Redis Queue [Task Queue, Message Broker] for Spring framework","archived":false,"fork":false,"pushed_at":"2024-12-20T15:25:48.000Z","size":10125,"stargazers_count":354,"open_issues_count":14,"forks_count":59,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-07T23:06:05.830Z","etag":null,"topics":["asynchronous-tasks","delayed-jobs","delayed-queue","java","queue","queue-tasks","queue-workers","queued-jobs","redis","rqueue","scheduled-jobs","scheduled-tasks","scheduler","spring","spring-boot","spring-framework","task-executor","task-manager","task-scheduler","workers"],"latest_commit_sha":null,"homepage":"https://sonus21.github.io/rqueue","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/sonus21.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"sonus21"}},"created_at":"2019-10-18T10:36:21.000Z","updated_at":"2025-03-26T15:35:17.000Z","dependencies_parsed_at":"2023-12-05T18:42:03.694Z","dependency_job_id":"158bdbbd-94f2-4a34-a4c4-e9d4e6dd473c","html_url":"https://github.com/sonus21/rqueue","commit_stats":{"total_commits":185,"total_committers":9,"mean_commits":"20.555555555555557","dds":0.08648648648648649,"last_synced_commit":"f04317b2155b4bd43460536296a1f3c4f0a4f8be"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonus21%2Frqueue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonus21%2Frqueue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonus21%2Frqueue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonus21%2Frqueue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sonus21","download_url":"https://codeload.github.com/sonus21/rqueue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254394720,"owners_count":22063984,"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":["asynchronous-tasks","delayed-jobs","delayed-queue","java","queue","queue-tasks","queue-workers","queued-jobs","redis","rqueue","scheduled-jobs","scheduled-tasks","scheduler","spring","spring-boot","spring-framework","task-executor","task-manager","task-scheduler","workers"],"created_at":"2024-09-28T00:05:27.798Z","updated_at":"2025-05-15T18:04:04.912Z","avatar_url":"https://github.com/sonus21.png","language":"Java","readme":"\u003cdiv\u003e\n   \u003cimg  align=\"left\" src=\"https://raw.githubusercontent.com/sonus21/rqueue/master/rqueue-core/src/main/resources/public/rqueue/img/android-chrome-192x192.png\" alt=\"Rqueue Logo\" width=\"90\"\u003e\n   \u003ch1 style=\"float:left\"\u003eRqueue: Redis Queue, Task Queue, Scheduled Queue for Spring and Spring Boot\u003c/h1\u003e\n\u003c/div\u003e\n\n[![Build Status](https://circleci.com/gh/sonus21/rqueue/tree/master.svg?style=shield)](https://circleci.com/gh/sonus21/rqueue/tree/master)\n[![Coverage Status](https://coveralls.io/repos/github/sonus21/rqueue/badge.svg?branch=master)](https://coveralls.io/github/sonus21/rqueue?branch=master)\n[![Maven Central](https://img.shields.io/maven-central/v/com.github.sonus21/rqueue-core)](https://repo1.maven.org/maven2/com/github/sonus21/rqueue-core)\n[![Javadoc](https://javadoc.io/badge2/com.github.sonus21/rqueue-core/javadoc.svg)](https://javadoc.io/doc/com.github.sonus21/rqueue-core)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n**Rqueue** is an asynchronous task executor(worker) built for spring and spring-boot framework based\non the spring framework's messaging library backed by Redis. It can be used as message broker as\nwell, where all services code is in Spring.\n\n\u003cbr/\u003e\n\n![Message Flow](https://raw.githubusercontent.com/sonus21/rqueue/master/docs/static/rqueue-message-flow.svg?sanitize=true)\n\n## Features\n\n* **Instant delivery** : Instant execute this message in the background\n* **Message scheduling** : A message can be scheduled for any arbitrary period\n* **Unique message** : Unique message processing for a queue based on the message id\n* **Periodic message** : Process same message at certain interval\n* **Priority tasks** : task having some special priority like high, low, medium\n* **Message delivery** : It's guaranteed that a message is consumed **at least once**.  (Message\n  would be consumed by a worker more than once due to the failure in the underlying\n  worker/restart-process etc, otherwise exactly one delivery)\n* **Message retry** : Message would be retried automatically on application crash/failure/restart\n  etc.\n* **Automatic message serialization and deserialization**\n* **Message Multicasting** : Call multiple message listeners on every message\n* **Batch Message Polling** : Fetch multiple messages from Redis at once\n* **Metrics** : In flight messages, waiting for consumption and scheduled messages\n* **Competing Consumers** : multiple messages can be consumed in parallel by different\n  workers/listeners.\n* **Concurrency** : Concurrency of any listener can be configured\n* **Queue Priority** :\n  * Group level queue priority(weighted and strict)\n  * Sub queue priority(weighted and strict)\n* **Long execution job** : Long running jobs can check in periodically.\n* **Execution Backoff** : Exponential and fixed back off (default fixed back off)\n* **Middleware** :  Add one or more middleware, middlewares are called before listener method.\n* **Callbacks** : Callbacks for dead letter queue, discard etc\n* **Events** : 1. Bootstrap event 2. Task execution event.\n* **Redis connection** : A different redis setup can be used for Rqueue\n* **Redis cluster** : Redis cluster can be used with Lettuce client.\n* **Redis Sentinel** : Redis sentinel can be used with Rqueue.\n* **Reactive Programming** : Supports reactive Redis and spring webflux\n* **Web Dashboard** :  Web dashboard to manage a queue and queue insights including latency\n\n### Requirements\n\n* Spring 5+, 6+\n* Java 1.8+,17\n* Spring boot 2+,3+\n* Lettuce client for Redis cluster\n* Read master preference for Redis cluster\n\n## Getting Started\n\n### Dependency\n\nSnapshot\nVersion: [https://s01.oss.sonatype.org/content/repositories/snapshots/com/github/sonus21/](https://s01.oss.sonatype.org/content/repositories/snapshots/com/github/sonus21/)\n\u003cbr/\u003eRelease Version: [Maven central](https://search.maven.org/search?q=g:com.github.sonus21)\n\n#### Spring Boot\n\n**NOTE:**\n\n* For spring boot 2.x use Rqueue 2.x\n* For spring boot 3.x use Rqueue 3.x\n\nGet the latest one\nfrom [Maven central](https://search.maven.org/search?q=g:com.github.sonus21%20AND%20a:rqueue-spring-boot-starter)\n\n* Add dependency\n  * Gradle\n    ```groovy\n        implementation 'com.github.sonus21:rqueue-spring-boot-starter:2.13.1-RELEASE'\n    ```\n  * Maven\n    ```xml\n     \u003cdependency\u003e\n        \u003cgroupId\u003ecom.github.sonus21\u003c/groupId\u003e\n        \u003cartifactId\u003erqueue-spring-boot-starter\u003c/artifactId\u003e\n        \u003cversion\u003e2.13.1-RELEASE\u003c/version\u003e\n    \u003c/dependency\u003e\n    ```\n\n  No additional configurations are required, only dependency is required.\n\n---\n\n#### Spring Framework\n\n**NOTE**\n\n* For spring framework 5.x use rqueue-spring 2.x\n* For spring framework 6.x use rqueue-spring 3.x\n\nGet the latest one\nfrom [Maven central](https://search.maven.org/search?q=g:com.github.sonus21%20AND%20a:rqueue-spring)\n\n* Add Dependency\n  * Gradle\n    ```groovy\n        implementation 'com.github.sonus21:rqueue-spring:2.13.1-RELEASE'\n    ```\n  * Maven\n    ```xml\n     \u003cdependency\u003e\n       \u003cgroupId\u003ecom.github.sonus21\u003c/groupId\u003e\n       \u003cartifactId\u003erqueue-spring\u003c/artifactId\u003e\n       \u003cversion\u003e2.13.1-RELEASE\u003c/version\u003e\n     \u003c/dependency\u003e\n    ```\n* Add annotation `EnableRqueue` on application config class\n* Provide a RedisConnectionFactory bean\n\n###### Configuration\n\n```java\n\n@EnableRqueue\npublic class Application {\n  @Bean\n  public RedisConnectionFactory redisConnectionFactory() {\n    // return a redis connection factory\n  }\n}\n```\n\n---\n\n### Message publishing/Task submission\n\nAll messages need to be sent using `RqueueMessageEnqueuer` bean's `enqueueXXX`, `enqueueInXXX`\nand `enqueueAtXXX` methods. It has handful number of `enqueue`, `enqueueIn`, `enqueueAt` methods, we\ncan use any one of them based on the use case.\n\n```java\npublic class MessageService {\n\n  @AutoWired\n  private RqueueMessageEnqueuer rqueueMessageEnqueuer;\n\n  public void doSomething() {\n    rqueueMessageEnqueuer.enqueue(\"simple-queue\", \"Rqueue is configured\");\n  }\n\n  public void createJOB(Job job) {\n    rqueueMessageEnqueuer.enqueue(\"job-queue\", job);\n  }\n\n  // send notification in 30 seconds\n  public void sendNotification(Notification notification) {\n    rqueueMessageEnqueuer.enqueueIn(\"notification-queue\", notification, 30 * 1000L);\n  }\n\n  // enqueue At example\n  public void createInvoice(Invoice invoice, Instant instant) {\n    rqueueMessageEnqueuer.enqueueAt(\"invoice-queue\", invoice, instant);\n  }\n\n  // enqueue with priority, when sub queues are used as explained in the queue priority section.\n  enum SmsPriority {\n    CRITICAL(\"critical\"),\n    HIGH(\"high\"),\n    MEDIUM(\"medium\"),\n    LOW(\"low\");\n    private String value;\n  }\n\n  public void sendSms(Sms sms, SmsPriority priority) {\n    rqueueMessageEnqueuer.enqueueWithPriority(\"sms-queue\", priority.value(), sms);\n  }\n\n  // Index chat every 1 minute\n  public void sendPeriodicEmail(Email email) {\n    rqueueMessageEnqueuer.enqueuePeriodic(\"chat-indexer\", chatIndexer, 60_000);\n  }\n\n}\n```\n\n---\n\n### Worker/Consumer/Task Executor/Listener\n\nAny method that's part of spring bean, can be marked as worker/message listener\nusing `RqueueListener` annotation\n\n```java\n\n@Component\n@Slf4j\npublic class MessageListener {\n\n  @RqueueListener(value = \"simple-queue\")\n  public void simpleMessage(String message) {\n    log.info(\"simple-queue: {}\", message);\n  }\n\n  @RqueueListener(value = \"job-queue\", numRetries = \"3\",\n      deadLetterQueue = \"failed-job-queue\", concurrency = \"5-10\")\n  public void onMessage(Job job) {\n    log.info(\"Job alert: {}\", job);\n  }\n\n  @RqueueListener(value = \"push-notification-queue\", numRetries = \"3\",\n      deadLetterQueue = \"failed-notification-queue\")\n  public void onMessage(Notification notification) {\n    log.info(\"Push notification: {}\", notification);\n  }\n\n  @RqueueListener(value = \"sms\", priority = \"critical=10,high=8,medium=4,low=1\")\n  public void onMessage(Sms sms) {\n    log.info(\"Sms : {}\", sms);\n  }\n\n  @RqueueListener(value = \"chat-indexing\", priority = \"20\", priorityGroup = \"chat\")\n  public void onMessage(ChatIndexing chatIndexing) {\n    log.info(\"ChatIndexing message: {}\", chatIndexing);\n  }\n\n  @RqueueListener(value = \"chat-indexing-daily\", priority = \"10\", priorityGroup = \"chat\")\n  public void onMessage(ChatIndexing chatIndexing) {\n    log.info(\"ChatIndexing message: {}\", chatIndexing);\n  }\n\n  // checkin job example\n  @RqueueListener(value = \"chat-indexing-weekly\", priority = \"5\", priorityGroup = \"chat\")\n  public void onMessage(ChatIndexing chatIndexing,\n      @Header(RqueueMessageHeaders.JOB) com.github.sonus21.rqueue.core.Job job) {\n    log.info(\"ChatIndexing message: {}\", chatIndexing);\n    job.checkIn(\"Chat indexing...\");\n  }\n}\n```\n\n---\n\n## Dashboard\n\nLink: [http://localhost:8080/rqueue](http://localhost:8080/rqueue)\n\n[![Dashboard](https://raw.githubusercontent.com/sonus21/rqueue/master/docs/static/stats-graph.png)](https://raw.githubusercontent.com/sonus21/rqueue/master/docs/static/stats-graph.png)\n\n#### Queue Statistics\n\nMicrometer based dashboard for queue\n\n[![Grafana Dashboard](https://raw.githubusercontent.com/sonus21/rqueue/master/docs/static/grafana-dashboard.png)](https://raw.githubusercontent.com/sonus21/rqueue/master/docs/static/grafana-dashboard.png)\n\n#### Message Waiting For Execution\n\n[![Explore Queue](https://raw.githubusercontent.com/sonus21/rqueue/master/docs/static/queue-explore.png)](https://raw.githubusercontent.com/sonus21/rqueue/master/docs/static/queue-explore.png)\n\n#### Recent jobs details\n\n[![Jobs](https://raw.githubusercontent.com/sonus21/rqueue/master/docs/static/jobs.png)](https://raw.githubusercontent.com/sonus21/rqueue/master/docs/static/jobs.png)\n\n---\n\n## Status\n\nRqueue is stable and production ready, it's processing 100K+ messages daily in production\nenvironment.\n**Some of the Rqueue Users**\n\n\u003ca href=\"https://airtel.africa\" target=\"_blank\"\u003e\n\u003cimg alt=\"Airtel\" src=\"https://raw.githubusercontent.com/sonus21/rqueue/master/docs/static/users/airtel-africa.png\" width=\"160\" align=\"middle\"/\u003e\n\u003c/a\u003e\n\u0026nbsp;\u0026nbsp;\n\u003ca href=\"https://vonage.com\" target=\"_blank\"\u003e\n  \u003cimg alt=\"Vonage\" src=\"https://raw.githubusercontent.com/sonus21/rqueue/master/docs/static/users/vonage.png\" width=\"160\" align=\"middle\"/\u003e\n\u003c/a\u003e\n\u0026nbsp;\u0026nbsp;\n\u003ca href=\"https://www.t-mobile.com\" target=\"_blank\"\u003e\n  \u003cimg alt=\"Vonage\" src=\"https://raw.githubusercontent.com/sonus21/rqueue/master/docs/static/users/t-mobile.svg\" align=\"middle\"/\u003e\n\u003c/a\u003e\n\u0026nbsp;\u0026nbsp;\n\u003ca href=\"https://line.me\" target=\"_blank\"\u003e\n  \u003cimg alt=\"Line Chat\" src=\"https://raw.githubusercontent.com/sonus21/rqueue/master/docs/static/users/line.png\" width=\"60\" height=\"60\" align=\"middle\"/\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://opentext.com/\" target=\"_blank\"\u003e\n  \u003cimg alt=\"Opentext\" src=\"https://raw.githubusercontent.com/sonus21/rqueue/master/docs/static/users/opentext.png\" width=\"200\" height=\"100\" align=\"middle\"/\u003e\n\u003c/a\u003e\n\n**We would love to add your organization name here, if you're one of the Rqueue users, please raise\na\nPR/[issue](https://github.com/sonus21/rqueue/issues/new?template=i-m-using-rqueue.md\u0026title=Add+my+organisation+in+Rqueue+Users)\n.**\n\n\n---\n\n\u003c!---- Signing Key\n~/.gradle/gradle.properties file\n\nsonatypeUsername=xyz\nsonatypePassword=xyz\nsigning.keyId=371EDCC6\nsigning.password=xyz\nsigning.secretKeyRingFile=/Users/sonu/.gnupg/secring.gpg\n\n\nFor signing generate gpg key using gpg tool using `gpg --gen-key`\n\nsigning.password is gpg key password\nsigning.keyId is last 8 character of gpg key, find using `gpg -K`\nsigning.secretKeyRingFile=/Users/sonu/.gnupg/secring.gpg generate this as `gpg --keyring secring.gpg --export-secret-keys \u003e ~/.gnupg/secring.gpg`\n\n---\u003e\n\n## Support\n\n* Please report bug,question,feature(s)\n  to [issue](https://github.com/sonus21/rqueue/issues/new/choose) tracker.\n* Ask question on StackOverflow using [#rqueue](https://stackoverflow.com/tags/rqueue) tag\n\n## Contribution\n\nYou are most welcome for any pull requests for any feature/bug/enhancement. You would need Java8 and\ngradle to start with. In root `build.gradle` file comment out spring related versions, or set\nenvironment variables for Spring versions. You can use [module, class and other diagrams](https://sourcespy.com/github/sonus21rqueue/) \nto familiarise yourself with the project.\n\n**Please format your code with Google Java formatter.**\n\n## Links\n\n* Documentation: [https://sonus21.github.io/rqueue](https://sonus21.github.io/rqueue)\n* Releases: [https://github.com/sonus21/rqueue/releases](https://github.com/sonus21/rqueue/releases)\n* Issue tracker: [https://github.com/sonus21/rqueue/issues](https://github.com/sonus21/rqueue/issues)\n* Maven Central:\n  * [https://repo1.maven.org/maven2/com/github/sonus21/rqueue-spring](https://repo1.maven.org/maven2/com/github/sonus21/rqueue-spring)\n  * [https://repo1.maven.org/maven2/com/github/sonus21/rqueue-spring-boot-starter](https://repo1.maven.org/maven2/com/github/sonus21/rqueue-spring-boot-starter)\n  \n* StackOverflow: [https://stackoverflow.com/tags/rqueue](https://stackoverflow.com/tags/rqueue)\n* Discord: https://discord.gg/2hgQZXS2\n* Project Progress: [https://github.com/sonus21/rqueue/projects/3](https://github.com/sonus21/rqueue/projects/3)\n\n## License\n\n© [Sonu Kumar](mailto:sonunitw12@gmail.com) 2019-Instant.now\n\nThe Rqueue is released under version 2.0 of the Apache License.\n","funding_links":["https://github.com/sponsors/sonus21"],"categories":["任务调度"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonus21%2Frqueue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsonus21%2Frqueue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonus21%2Frqueue/lists"}