{"id":18250539,"url":"https://github.com/dropwizard/dropwizard-redis","last_synced_at":"2025-12-25T15:47:15.557Z","repository":{"id":36967449,"uuid":"185870867","full_name":"dropwizard/dropwizard-redis","owner":"dropwizard","description":"A convenience library for Redis integration in a Dropwizard service.","archived":false,"fork":false,"pushed_at":"2025-03-31T06:28:32.000Z","size":423,"stargazers_count":13,"open_issues_count":4,"forks_count":5,"subscribers_count":6,"default_branch":"release/4.0.x","last_synced_at":"2025-03-31T07:28:36.432Z","etag":null,"topics":["dropwizard","lettuce-client","redis","redis-client"],"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/dropwizard.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":"2019-05-09T20:59:05.000Z","updated_at":"2025-03-31T06:28:28.000Z","dependencies_parsed_at":"2023-02-17T16:45:29.478Z","dependency_job_id":"7d728cbb-3467-4859-9f79-05c7266b93c5","html_url":"https://github.com/dropwizard/dropwizard-redis","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropwizard%2Fdropwizard-redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropwizard%2Fdropwizard-redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropwizard%2Fdropwizard-redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropwizard%2Fdropwizard-redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dropwizard","download_url":"https://codeload.github.com/dropwizard/dropwizard-redis/tar.gz/refs/heads/release/4.0.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247209381,"owners_count":20901766,"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":["dropwizard","lettuce-client","redis","redis-client"],"created_at":"2024-11-05T09:45:02.888Z","updated_at":"2025-12-25T15:47:15.518Z","avatar_url":"https://github.com/dropwizard.png","language":"Java","readme":"# dropwizard-redis\n\nProvides easy integration for Dropwizard applications with Redis via the Lettuce library.\n\nThis bundle comes with out-of-the-box support for:\n* Configuration\n* Client lifecycle management\n* Client health checks\n* Dropwizard Metrics integration\n* Brave distributed tracing instrumentation integration for the Lettuce client.\n* Support for the Lettuce cluster client.\n* Support for the Lettuce sentinel client\n* Support the the Lettuce basic Redis client\n\nFor more information on Redis, take a look at the official documentation here: https://redis.io/documentation\n\nFor More information on the Redis client used (Lettuce), see: https://github.com/lettuce-io/lettuce-core\n\n## Dropwizard Version Support Matrix\n| dropwizard-redis | Dropwizard v1.3.x  | Dropwizard v2.0.x  | Dropwizard v2.1.x  | Dropwizard v3.0.x  | Dropwizard v4.0.x  |\n|------------------|--------------------|--------------------|--------------------|--------------------|--------------------|\n| v1.3.x           | :white_check_mark: | :white_check_mark: | :x:                | :x:                | :x:                |\n| v1.4.x           | :white_check_mark: | :white_check_mark: | :x:                | :x:                | :x:                |\n| v1.5.x           | :white_check_mark: | :white_check_mark: | :x:                | :x:                | :x:                |\n| v1.6.x           | :white_check_mark: | :white_check_mark: | :x:                | :x:                | :x:                |\n| v1.7.x           | :white_check_mark: | :white_check_mark: | :question:         | :x:                | :x:                |\n| v1.8.x           | :x:                | :question:         | :white_check_mark: | :x:                | :x:                |\n| v3.0.x           | :x:                | :x:                | :x:                | :white_check_mark: | :x:                |\n| v4.0.x           | :x:                | :x:                | :x:                | :x:                | :white_check_mark: |\n\n## Usage\nAdd dependency on library.\n\nMaven:\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.dropwizard.modules\u003c/groupId\u003e\n  \u003cartifactId\u003edropwizard-redis\u003c/artifactId\u003e\n  \u003cversion\u003e$latest-version\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nGradle:\n```groovy\ncompile \"io.dropwizard.modules:dropwizard-redis:$latest-version\"\n```\n\n\n### Basic Lettuce Client\nIn your Dropwizard `Configuration` class, configure a `RedisClientFactory`:\n```java\n@Valid\n@NotNull\n@JsonProperty(\"redis\")\nprivate RedisClientFactory\u003cString, String\u003e redisClientFactory;\n```\n\nThen, in your `Application` class, you'll want to do something similar to the following:\n```java\nprivate final RedisClientBundle\u003cString, String, ExampleConfiguration\u003e redis = new RedisClientBundle\u003cString, String, ExampleConfiguration\u003e() {\n    @Override\n    public RedisClientFactory\u003cString, String\u003e getRedisClientFactory(ExampleConfiguration configuration) {\n        return configuration.getRedisClientFactory();\n    }\n};\n\n@Override\npublic void initialize(Bootstrap\u003cExampleConfiguration\u003e bootstrap) {\n    bootstrap.addBundle(redis);\n}\n\n@Override\npublic void run(ExampleConfiguration config, Environment environment) {\n    final StatefulRedisConnection\u003cString, String\u003e connection = redisCluster.getConnection();\n    final PersonCache personCache = new PersonCache(connection); // PersonCache is an arbtirary example\n    environment.jersey().register(new PersonResource(personCache));\n}\n```\n\n\n```yaml\nredis:\n  type: basic\n  name: my-redis-use-case\n  node:\n    type: redis\n    node: \"127.0.0.1:6379\"\n    clientName: person-app\n  redisCodec:\n    type: string\n  clientResources:\n    type: default\n    commandLatencyRecorder:\n      type: default\n      enabled: false\n```\n\n\n### Lettuce Cluster Client\nIn your Dropwizard `Configuration` class, configure a `RedisClusterClientFactory`:\n```java\n@Valid\n@NotNull\n@JsonProperty(\"redis-cluster\")\nprivate RedisClusterClientFactory\u003cString, String\u003e redisClientFactory;\n```\n\nThen, in your `Application` class, you'll want to do something similar to the following:\n```java\nprivate final RedisClusterClientBundle\u003cString, String, ExampleConfiguration\u003e redisCluster = new RedisClusterClientBundle\u003cString, String, ExampleConfiguration\u003e() {\n    @Override\n    public RedisClusterClientFactory\u003cString, String\u003e getRedisClusterClientFactory(ExampleConfiguration configuration) {\n        return configuration.getRedisClusterClientFactory();\n    }\n};\n\n@Override\npublic void initialize(Bootstrap\u003cExampleConfiguration\u003e bootstrap) {\n    bootstrap.addBundle(redisCluster);\n}\n\n@Override\npublic void run(ExampleConfiguration config, Environment environment) {\n    final StatefulRedisClusterConnection\u003cString, String\u003e clusterConnection = redisCluster.getClusterConnection();\n    final PersonCache personCache = new PersonCache(clusterConnection); // PersonCache is an arbtirary example\n    environment.jersey().register(new PersonResource(personCache));\n}\n```\n\nConfigure your factory in your `config.yml` file:\n```yaml\nredis-cluster:\n  type: cluster\n  name: my-redis-cluster-use-case\n  nodes:\n    - type: redis\n      node: \"127.0.0.1:6379\"\n      clientName: person-app\n      password: hunter2\n  redisCodec:\n    type: string\n  clientResources:\n    type: default\n    commandLatencyRecorder:\n      type: default\n      enabled: false\n  # TODO: add more configs than just the required basics\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdropwizard%2Fdropwizard-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdropwizard%2Fdropwizard-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdropwizard%2Fdropwizard-redis/lists"}