{"id":23740145,"url":"https://github.com/cobbzilla/jestrel","last_synced_at":"2025-09-04T15:32:01.495Z","repository":{"id":7563664,"uuid":"8917437","full_name":"cobbzilla/jestrel","owner":"cobbzilla","description":"Simple Java client for Kestrel message queue","archived":false,"fork":false,"pushed_at":"2016-08-11T22:33:44.000Z","size":26,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-16T18:57:51.453Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cobbzilla.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-21T00:09:09.000Z","updated_at":"2024-04-16T18:57:51.454Z","dependencies_parsed_at":"2022-08-29T19:01:58.480Z","dependency_job_id":null,"html_url":"https://github.com/cobbzilla/jestrel","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/cobbzilla%2Fjestrel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobbzilla%2Fjestrel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobbzilla%2Fjestrel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobbzilla%2Fjestrel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cobbzilla","download_url":"https://codeload.github.com/cobbzilla/jestrel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231970948,"owners_count":18453930,"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-12-31T09:47:16.672Z","updated_at":"2024-12-31T09:47:17.519Z","avatar_url":"https://github.com/cobbzilla.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"jestrel\n=======\n\nSimple Java client for Kestrel\n\n### Motivation\n\nWorking with Kestrel queues should be easy. But after scouring the web, I couldn't find a \"native\" Kestrel client\nfor Java, only some memcached clients that had some support for Kestrel-specific stuff.\n\nSo, building on top of the xmemcached library on googlecode, I wrote jestrel\n\n### System Requirements\n\n* Java 7\n* Maven 3\n\n### Building\n\n    mvn package\n\n### Usage\n\n#### Initialize the client library\n\n    // Setup configuration\n    Properties kestrelProperties = new Properties();\n\n    // Max # of connections to kestrel. default is 1\n    kestrelProperties.setProperty(\"kestrelConnectionPoolSize\", \"10\");\n\n    // Comma-separated list of hostname:port of all kestrel servers to use. required.\n    kestrelProperties.setProperty(\"kestrelHosts\", \"kestrel-1:22133, kestrel-2:22133\");\n\n    // How often should the client drop its connection to kestrel and reconnect. default is 5 minutes\n    // If you are using multiple kestrel servers, this will ensure that no kestrel server sits idle with no clients\n    kestrelProperties.setProperty(\"kestrelReconnectIntervalInMinutes\", \"5\");\n\n    // Create a client\n    MqClientFactory clientFactory = new MqClientFactory();\n    MqClient client = clientFactory.createClient(KestrelClient.class, kestrelProperties);\n\n### Sending a message\n\n    String queueName = \"some_queue\";\n    MqProducer producer = client.getProducer(queueName);\n    producer.send(\"some message\");\n\n### Registering a queue consumer\n\n    // I'm using an inline class here for brevity.\n    // You will probably want to create your own class that implements the MqConsumer interface.\n    MqConsumer consumer = new MqConsumer() {\n        /**\n         * @param o The message, which will be a String\n         * @exception Exception If any exception is thrown, the message will be put onto the errorQueue (unless it was set to null when the consumer was registered)\n         */\n        public void onMessage(Object o) throws Exception {\n            System.out.println(\"received: \" + o.toString());\n        }\n    };\n\n    String queueName = \"some_queue\";\n    String errorQueueName = \"some_queue_error\";\n\n    client.registerConsumer(consumer, queueName, errorQueueName);\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcobbzilla%2Fjestrel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcobbzilla%2Fjestrel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcobbzilla%2Fjestrel/lists"}