{"id":15069805,"url":"https://github.com/hellokaton/redis-dqueue","last_synced_at":"2025-08-20T20:33:15.270Z","repository":{"id":39918310,"uuid":"223964883","full_name":"hellokaton/redis-dqueue","owner":"hellokaton","description":"redis base delay queue","archived":false,"fork":false,"pushed_at":"2024-12-03T09:02:49.000Z","size":78,"stargazers_count":44,"open_issues_count":3,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-03T10:19:48.625Z","etag":null,"topics":["delay-queue","java8","redis-delay-queue"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hellokaton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-25T14:13:59.000Z","updated_at":"2024-12-03T09:02:46.000Z","dependencies_parsed_at":"2024-09-29T14:01:11.264Z","dependency_job_id":null,"html_url":"https://github.com/hellokaton/redis-dqueue","commit_stats":null,"previous_names":["biezhi/redis-dqueue"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellokaton%2Fredis-dqueue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellokaton%2Fredis-dqueue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellokaton%2Fredis-dqueue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellokaton%2Fredis-dqueue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hellokaton","download_url":"https://codeload.github.com/hellokaton/redis-dqueue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230454430,"owners_count":18228392,"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":["delay-queue","java8","redis-delay-queue"],"created_at":"2024-09-25T01:44:47.787Z","updated_at":"2024-12-19T15:10:11.762Z","avatar_url":"https://github.com/hellokaton.png","language":"Java","readme":"# redis-dqueue\n\n`redis-dqueue` is a `redis` + `Java 8` base delayed queue library.\n\n**[Document](https://github.com/biezhi/redis-dqueue/wiki)**\n\n[![Travis Build](https://travis-ci.org/biezhi/redis-dqueue.svg?branch=master)](https://travis-ci.org/biezhi/redis-dqueue)\n[![](https://img.shields.io/maven-central/v/io.github.biezhi/redis-dqueue.svg)](https://mvnrepository.com/artifact/io.github.biezhi/redis-dqueue)\n[![License](https://img.shields.io/badge/license-Apache2-blue.svg)](https://github.com/biezhi/redis-dqueue/blob/master/LICENSE)\n[![Twitter URL](https://img.shields.io/twitter/url/https/twitter.com/biezhii.svg?style=social\u0026label=Follow%20Twitter)](https://twitter.com/biezhii)\n\n## Feature\n\n- Push message delay\n- Consumer allowed to try again\n- Based on the message separation of the topic\n- Integrated SpringBoot\n\n## Normal Java Application\n\nWith Maven\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.github.biezhi\u003c/groupId\u003e\n    \u003cartifactId\u003eredis-dqueue-core\u003c/artifactId\u003e\n    \u003cversion\u003e0.0.3.ALPHA\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Push message and subscribe topic\n\n```java\nRDQueue rdQueue = new RDQueue(new Config());\n\n// \"hello world\" messages sent after 10 seconds\nMessage\u003cString\u003e message = new Message\u003c\u003e(\"TEST_TOPIC\", \"hello world\", 10);\n\n// async push delay message\nrdQueue.asyncPush(message, (key, throwable) -\u003e log.info(\"key send ok:\" + key));\n\n// subscribe topic\nrdQueue.subscribe(\"TEST_TOPIC\", callback());\n```\n\n**Callback**\n\n```java\nprivate static Callback\u003cString\u003e callback() {\n    return new Callback\u003cString\u003e() {\n        @Override\n        public ConsumeStatus execute(String data) {\n            log.info(\"消费数据:: {}\", data);\n            return ConsumeStatus.CONSUMED;\n        }\n    };\n}\n```\n\n## Spring Boot Application\n\nWith Maven\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.github.biezhi\u003c/groupId\u003e\n    \u003cartifactId\u003eredis-dqueue-spring-boot-starter\u003c/artifactId\u003e\n    \u003cversion\u003e0.0.3.ALPHA\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Push message\n\n```java\n@Autowired\nprivate RDQueueTemplate rdQueueTemplate;\n\n@GetMapping(\"/push\")\npublic String push(String id) throws RDQException {\n    Message\u003cString\u003e message = new Message\u003c\u003e();\n    message.setTopic(\"order-cancel\");\n    message.setPayload(id);\n    message.setDelayTime(10);\n    rdQueueTemplate.asyncPush(message, (s, throwable) -\u003e {\n      // TODO async push result\n    });\n    return \"推送成功\";\n}\n```\n\n### Subscribe topic\n\nYou need to implement `MessageListener`, subscribe to the related topic, process delay messages in the execute method.\n\n\u003e Ensure that the class was Spring managed.\n\n```java\n@Component\npublic class OrderCancelListener implements MessageListener\u003cString\u003e {\n    \n    @Override\n    public String topic() {\n        return \"order-cancel\";\n    }\n    \n    @Override\n    public ConsumeStatus execute(String data) {\n        log.info(\"取消订单: {}\", data);\n        return ConsumeStatus.CONSUMED;\n    }\n    \n}\n```\n\n## Lisence\n\n[Apache2](LISENCE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhellokaton%2Fredis-dqueue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhellokaton%2Fredis-dqueue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhellokaton%2Fredis-dqueue/lists"}