{"id":19885235,"url":"https://github.com/dinstone/grape","last_synced_at":"2026-03-16T22:02:55.691Z","repository":{"id":44220609,"uuid":"100771626","full_name":"dinstone/grape","owner":"dinstone","description":"Grape is a distributed delay job system like beanstalkd, which build based on Redis.","archived":false,"fork":false,"pushed_at":"2025-04-02T09:10:57.000Z","size":950,"stargazers_count":9,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T10:24:57.717Z","etag":null,"topics":["delay-job-system","redis"],"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/dinstone.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-19T05:10:46.000Z","updated_at":"2025-04-02T09:11:01.000Z","dependencies_parsed_at":"2024-04-22T12:31:56.237Z","dependency_job_id":"cc38bbdd-ffd5-4426-bd4a-fe0381ca209e","html_url":"https://github.com/dinstone/grape","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinstone%2Fgrape","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinstone%2Fgrape/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinstone%2Fgrape/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinstone%2Fgrape/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dinstone","download_url":"https://codeload.github.com/dinstone/grape/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252071811,"owners_count":21690095,"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-job-system","redis"],"created_at":"2024-11-12T17:33:42.095Z","updated_at":"2026-03-16T22:02:50.640Z","avatar_url":"https://github.com/dinstone.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Grape Introduce\n\nGrape is a distributed delay job system based on Redis.\n\n[真正的千万级分布式延迟任务系统 Grape](https://dinstone.github.io/2023/07/07/delay-task-with-redis/)\n\n## Releases\n\n* [1.3.3] Rest API bugfix\n\n* [1.3.2] Redis version 3.0.2\n\n* [1.3.1] improve API and bugfix.\n\n* [1.3.0](https://github.com/dinstone/grape/releases/tag/1.3.0) support redis cluster model.\n\n* [1.2.2](https://github.com/dinstone/grape/releases/tag/1.2.2)  is a stable version of 1.2 and has fixed several bugs.\n\n* 1.3.1 optimized the scheduling model and supports zero delay scheduling algorithms\n\n* 1.1.0 add admin web UI project.\n\n* 1.0.0 have released a Redis based delayed job system and opened the rest interface.\n\n## Job Lifecycle\n\nA job in Grape during its life it can be in one of four states: \"delay\", \"ready\", \"remain\", or \"failed\".\n\nHere is a picture of the typical job lifecycle:\n\n![image](https://dinstone.github.io/img/arch/grape-status.png)\n\n## Admin UI\n\nAccess grape admin endpoint: http://localhost:9595/\n\n![image](https://github.com/dinstone/grape/wiki/images/admin-main.jpeg)\n\n![image](https://github.com/dinstone/grape/wiki/images/admin-chart.png)\n\n# Quick Start [快速开始](https://github.com/dinstone/grape/wiki/Quick.md)\n\n## step 1: clone project from github\n\n```shell\ngit clone https://github.com/dinstone/grape.git\n```\n\n## step 2: source building\n\n```shell\ncd grape\nmaven package\n```\n\n## step 3: deployment package\n\n```shell\ncd grape/grape-server/target\nunzip grape-server-1.3.0.zip\ncd grape-server-1.3.0/config/\n```\n\nedit redis config from config.json file.\n\n* jedis pooled client config\n\n```json\n{\n    \"redis\": {\n      \"nodes\": [\n        {\n          \"host\": \"127.0.0.1\",\n          \"port\": 6379\n        }\n      ],\n      \"model\": \"pooled\",\n      \"maxTotal\": 8,\n      \"minIdle\": 1,\n      \"timeout\": 2000,\n      \"maxWaitMillis\": 3000,\n      \"numTestsPerEvictionRun\": -1,\n      \"minEvictableIdleTimeMillis\": 60000,\n      \"timeBetweenEvictionRunsMillis\": 30000\n    }\n}\n```\n\n* jedis cluster client config\n\n```json\n{\n    \"redis\": {\n      \"nodes\": [\n        {\n          \"host\": \"192.168.1.120\",\n          \"port\": 7001\n        },\n        {\n          \"host\": \"192.168.1.120\",\n          \"port\": 7002\n        },\n        {\n          \"host\": \"192.168.1.120\",\n          \"port\": 7003\n        }\n      ],\n      \"model\": \"cluster\",\n      \"maxTotal\": 4,\n      \"minIdle\": 1,\n      \"timeout\": 2000,\n      \"maxWaitMillis\": 3000,\n      \"numTestsPerEvictionRun\": -1,\n      \"minEvictableIdleTimeMillis\": 60000,\n      \"timeBetweenEvictionRunsMillis\": 30000\n    }\n}\n```\n\nedit users info from user.json file.\n\n```json\n{\n\t\"admin\": {\n\t\t\"password\": \"grape\",\n\t\t\"roles\": [\n\t\t\t\"writer\",\n\t\t\t\"reader\"\n\t\t]\n\t},\n\t\"guid\": {\n\t\t\"password\": \"grape\",\n\t\t\"roles\": [\n\t\t\t\"reader\"\n\t\t]\n\t}\n}\n```\n\n## step 4: start grape by script\n\n```shell\ncd grape-server-1.3.1/bin\n./start.sh\n```\n\n## step 5: stop grape by script\n\n```shell\ncd grape-server-1.3.1/bin\n./stop.sh\n```\n\n# API and Examples\n\nYou can find the complete [API Definition](https://documenter.getpostman.com/view/8030511/SVYoufE8) here.\n\n### Produce API\n\n```shell\nExample Request\ncurl --location 'http://localhost:9521/api/job/produce?tube=test\u0026jid=j004\u0026dtr=1000\u0026ttr=10000' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"orderId\": \"j001\",\n    \"sumMoney\": 2000,\n    \"count\": 10000\n}'\n\nExample Response 200 － OK\ntrue\n```\n\n### Delete API\n\n```shell\nExample Request\ncurl --location --request DELETE 'http://localhost:9521/api/job/delete?tube=test\u0026jid=j001'\n\nExample Response200 OK\ntrue\n```\n\n### Consume API\n\n```shell\nExample Request\ncurl --location 'http://localhost:9521/api/job/consume?tube=test\u0026max=10'\n\nExample Response200 OK\n[\n    {\n        \"id\": \"j004\",\n        \"dtr\": 1000,\n        \"ttr\": 10000,\n        \"noe\": 0,\n        \"data\": \"ewogICAgIm9yZGVySWQiOiAiajAwMSIsCiAgICAic3VtTW9uZXkiOiAyMDAwLAogICAgImNvdW50IjogMTAwMDAKfQ\"\n    }\n]\n```\n\n### Finish API\n\n```shell\nExample Request\ncurl --location --request DELETE 'http://localhost:9521/api/job/finish?tube=test\u0026jid=j003'\n\nExample Response200 OK\ntrue\n```\n\n### Release API\n\n```shell\nExample Request\ncurl --location --request PUT 'http://localhost:9521/api/job/release?tube=test\u0026jid=j001\u0026dtr=20000'\n\nExample Response200 OK\ntrue\n```\n\n### Tube list API\n\n```shell\nExample Request\ncurl --location 'http://localhost:9521/api/tube/list'\n\nExample Response200 OK\n[\n    \"test\"\n]\n```\n\n### Tube Stats API\n\n```shell\nExample Request\ncurl --location 'http://localhost:9521/api/tube/stats'\n\nExample Response200 OK\n[\n    {\n        \"dateTime\": 1689390610122,\n        \"tubeName\": \"test\",\n        \"totalJobSize\": 0,\n        \"finishJobSize\": 0,\n        \"delayQueueSize\": 0,\n        \"retainQueueSize\": 0,\n        \"failedQueueSize\": 1\n    }\n]\n```\n# Documents\n\n[架构设计](https://github.com/dinstone/grape/wiki)\n\n[快速开始](https://github.com/dinstone/grape/wiki/Quick)\n\n\n# License\n\nGrape is released under the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinstone%2Fgrape","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdinstone%2Fgrape","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinstone%2Fgrape/lists"}