{"id":16681745,"url":"https://github.com/casidiablo/java-bloomd-client","last_synced_at":"2025-06-14T06:02:39.764Z","repository":{"id":140747791,"uuid":"57096855","full_name":"casidiablo/java-bloomd-client","owner":"casidiablo","description":"Java client for bloomd","archived":false,"fork":false,"pushed_at":"2020-06-24T11:33:43.000Z","size":108,"stargazers_count":10,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-11T23:12:34.564Z","etag":null,"topics":["bloomd","rxjava-extension"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/casidiablo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2016-04-26T04:05:51.000Z","updated_at":"2025-02-06T15:59:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"0980c4c2-b058-4bea-bf98-24c6f10f740b","html_url":"https://github.com/casidiablo/java-bloomd-client","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/casidiablo/java-bloomd-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casidiablo%2Fjava-bloomd-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casidiablo%2Fjava-bloomd-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casidiablo%2Fjava-bloomd-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casidiablo%2Fjava-bloomd-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/casidiablo","download_url":"https://codeload.github.com/casidiablo/java-bloomd-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casidiablo%2Fjava-bloomd-client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259768513,"owners_count":22908228,"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":["bloomd","rxjava-extension"],"created_at":"2024-10-12T14:05:10.530Z","updated_at":"2025-06-14T06:02:39.759Z","avatar_url":"https://github.com/casidiablo.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## java-bloomd-client\n\nJava client for [armon's bloomd](https://github.com/armon/bloomd) built atop [netty](https://github.com/netty/netty).\n\n### Usage\n\nInteractions with a `bloomd` server are done through the `BloomdClient` interface which\ncan be created using the `BloomdClient.newInstance(\"host\", port)` method. The API is\npurely asynchronous so all methods provided by the interface, including `newInstance`,\nreturn a `Future`.\n\n```java\n// get bloomd client implementation\nBloomdClient client = BloomdClient.newInstance(\"localhost\", port).get();\n\n// create a filter\nassert client.create(\"someFilterName\").get() == CreateResult.DONE;\n\n// set and check for an item\nassert client.set(\"someFilterName\", \"nishtiman\").get() == StateResult.YES;\nassert client.check(\"someFilterName\", \"nishtiman\").get() == StateResult.YES;\nassert client.check(\"someFilterName\", \"non-extant\").get() == StateResult.NO;\n```\n\n### RxJava extension\n\nUsing `Future`s, though a common practice for asynchronous APIs, is cumbersome due to the limitations of this interface. A RxJava extension is provided that provides a better way to chain computations as well as centralize error handling and timeouts, etc. Here's the same example presented above but using RxJava:\n\n```java\nRxBloomdClient client = RxBloomdClient.newInstance(\"localhost\", 8673);\n\n// make sure filters can be created\nTestSubscriber\u003cStateResult\u003e subscriber = new TestSubscriber\u003c\u003e();\nclient.create(\"someFilterName\")\n      .flatMap(createResult -\u003e {\n          // filter should have been created\n          assert createResult == CreateResult.DONE; \n     \n          return client.set(\"someFilterName\", \"nishtiman\");\n      })\n      .flatMap(setResult -\u003e {\n          // should be YES because the filter didn't have the item\n          assert setResult == StateResult.YES;\n      \n          return client.check(\"someFilterName\", \"nishtiman\");\n      })\n      .flatMap(checkResult -\u003e {\n          // should be YES because the filter had the item\n          assert checkResult == StateResult.YES;\n      \n          return client.check(\"someFilterName\", \"non-extant\");\n      })\n      .doOnNext(checkResult -\u003e {\n          // should be NO because the filter does not have \"non-extant\"\n          assert checkResult == StateResult.NO;\n      })\n      .doOnError(throwable -\u003e {\n          // should never hit this\n          assert false;\n      })\n      .subscribe(subscriber);\n```\n\n### Connection pooling\n\nA pooling mechanism is provided to allow concurrent connections to a single server:\n\n```java\nint poolSize = 20;\nBloomdClientPool bloomdClientPool = new BloomdClientPool(\"host\", 8673, poolSize);\n\n// acquire a new client from the pool\nFuture\u003cBloomdClient\u003e clientFuture = bloomdClientPool.acquire();\nBloomdClient client = clientFuture.get();\n\n// do some cool stuff...\n\n// release client\nFuture\u003cVoid\u003e releaseFuture = bloomdClientPool.release(client);\n```\n\nThe RxJava extension also offers a pooling implementation atop `BloomdClientPool`:\n\n```java\nRxBloomdClientPool rxClientPool = new RxBloomdClientPool(\"host\", 8673, 5);\nObservable\u003cRxBloomdClient\u003e clientObservable = rxClientPool.acquire();\n```\n\n### Installation\n\nGradle:\n\n```groovy\nrepositories {\n    maven { url \"https://jitpack.io\" }\n}\n\ndependencies {\n    compile 'com.github.casidiablo.java-bloomd-client:bloomd-client:0.13'\n    compile 'com.github.casidiablo.java-bloomd-client:rx-bloomd-client:0.13'\n}\n```\n\nLeiningen:\n\n```clojure\n:repositories [[\"jitpack\" \"https://jitpack.io\"]]\n:dependencies [[com.github.casidiablo.java-bloomd-client/bloomd-client \"0.13\"]]\n```\n\nMaven:\n\n```xml\n\u003crepositories\u003e\n    \u003crepository\u003e\n\t    \u003cid\u003ejitpack.io\u003c/id\u003e\n\t\t\u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003ecom.github.casidiablo.java-bloomd-client\u003c/groupId\u003e\n        \u003cartifactId\u003ebloomd-client\u003c/artifactId\u003e\n        \u003cversion\u003e0.13\u003c/version\u003e\n        \u003cscope\u003ecompile\u003c/scope\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasidiablo%2Fjava-bloomd-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcasidiablo%2Fjava-bloomd-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasidiablo%2Fjava-bloomd-client/lists"}