{"id":19885234,"url":"https://github.com/dinstone/beanstalkc","last_synced_at":"2025-05-02T16:31:36.154Z","repository":{"id":7612726,"uuid":"8971109","full_name":"dinstone/beanstalkc","owner":"dinstone","description":"Beanstalkc is a thread-safe client library of the beanstalkd.","archived":false,"fork":false,"pushed_at":"2023-10-04T20:29:55.000Z","size":265,"stargazers_count":42,"open_issues_count":3,"forks_count":15,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T03:25:30.923Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/dinstone.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":"2013-03-23T14:02:24.000Z","updated_at":"2024-11-27T05:39:10.000Z","dependencies_parsed_at":"2024-11-12T17:36:32.688Z","dependency_job_id":"386aabf9-0d2f-46d5-86f2-cceab311063d","html_url":"https://github.com/dinstone/beanstalkc","commit_stats":null,"previous_names":["dinstone/com.dinstone.beanstalkc"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinstone%2Fbeanstalkc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinstone%2Fbeanstalkc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinstone%2Fbeanstalkc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinstone%2Fbeanstalkc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dinstone","download_url":"https://codeload.github.com/dinstone/beanstalkc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252071782,"owners_count":21690090,"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":[],"created_at":"2024-11-12T17:33:41.916Z","updated_at":"2025-05-02T16:31:35.408Z","avatar_url":"https://github.com/dinstone.png","language":"Java","funding_links":[],"categories":["消息队列客户端"],"sub_categories":["微服务框架"],"readme":"# What\n\nBeanstalkc is a thread-safe client library of the [beanstalkd](https://beanstalkd.github.io), which support connection pool.\n\n# How\n\n## Add Maven Dependency:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.dinstone.beanstalkc\u003c/groupId\u003e\n  \u003cartifactId\u003ebeanstalkc-netty\u003c/artifactId\u003e\n  \u003cversion\u003e2.4.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nor\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.dinstone.beanstalkc\u003c/groupId\u003e\n  \u003cartifactId\u003ebeanstalkc-mina\u003c/artifactId\u003e\n  \u003cversion\u003e2.4.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Example:\n\n```java\npublic static void main(String[] args) {\n    // set beanstalkd service host and port and other connetion config,\n    // then create job producer or consumer by this config.\n    Configuration config = new Configuration();\n    config.setServiceHost(\"192.168.1.120\");\n    config.setServicePort(11300);\n    config.setConnectTimeout(2000);\n    config.setReadTimeout(3000);\n    BeanstalkClientFactory factory = new BeanstalkClientFactory(config);\n    \n    // create an producer instance \n    JobProducer producer = factory.createJobProducer(\"pctube\");\n    \n    // publish delay job to beanstalkd\n    producer.putJob(1, 1, 5000, \"dddd\".getBytes());\n\n    // create an consumer instance  \n    JobConsumer consumer = factory.createJobConsumer(\"pctube\");\n\n    // peek delay job from beanstalkd\n    Job job = consumer.reserveJob(1);\n    \n    // do someting\n    System.out.println(\"id = \" + job.getId() + \" ; data = \" + new String(job.getData()));\n    \n    // job execute success, then delete it\n    consumer.deleteJob(job.getId());\n    \n    // finnally close client and release resources\n    producer.close();\n    consumer.close();\n}\n```\n        ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinstone%2Fbeanstalkc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdinstone%2Fbeanstalkc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinstone%2Fbeanstalkc/lists"}