{"id":27103020,"url":"https://github.com/yoanesber/spring-boot-redis-subscriber-lettuce","last_synced_at":"2026-05-05T20:38:34.449Z","repository":{"id":283195939,"uuid":"950773892","full_name":"yoanesber/Spring-Boot-Redis-Subscriber-Lettuce","owner":"yoanesber","description":"This project is a Spring Boot application that implements a Redis subscriber using Redis Lettuce. The application listens to messages published to a specific Redis channel and processes them accordingly.","archived":false,"fork":false,"pushed_at":"2025-04-06T15:32:02.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T16:33:21.388Z","etag":null,"topics":["event-driven","lettuce","redis","spring-boot","subscriber"],"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/yoanesber.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":"2025-03-18T17:03:43.000Z","updated_at":"2025-04-06T15:32:05.000Z","dependencies_parsed_at":"2025-03-30T16:27:46.618Z","dependency_job_id":null,"html_url":"https://github.com/yoanesber/Spring-Boot-Redis-Subscriber-Lettuce","commit_stats":null,"previous_names":["yoanesber/spring-boot-redis-subscriber-lettuce"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoanesber%2FSpring-Boot-Redis-Subscriber-Lettuce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoanesber%2FSpring-Boot-Redis-Subscriber-Lettuce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoanesber%2FSpring-Boot-Redis-Subscriber-Lettuce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoanesber%2FSpring-Boot-Redis-Subscriber-Lettuce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yoanesber","download_url":"https://codeload.github.com/yoanesber/Spring-Boot-Redis-Subscriber-Lettuce/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247516568,"owners_count":20951705,"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":["event-driven","lettuce","redis","spring-boot","subscriber"],"created_at":"2025-04-06T16:38:32.049Z","updated_at":"2026-05-05T20:38:29.427Z","avatar_url":"https://github.com/yoanesber.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Redis Subscriber with Spring Boot\n\n## 📖 Overview\nThis project is a Spring Boot application that implements a **Redis subscriber** using **Redis Lettuce**. The application listens to messages published to a specific Redis channel and processes them accordingly.\n\n### 🚀 Key Features of Redis\n- **Redis Pub/Sub Mechanism** – Subscribes to Redis channels and listens for incoming messages.\n- **Spring Boot Integration** – Uses spring-boot-starter-data-redis for Redis communication.\n- **Lettuce Client** – Implements Redis connection using Lettuce for efficient handling.\n- **Asynchronous Processing** – Listens and processes messages in real time.\n\n---\n\n## 🤖 Tech Stack\nThe technology used in this project are:  \n- `Spring Boot Starter Web` – Web application support.\n- `Redis with Lettuce` – Redis integration with Lettuce Redis client for efficient handling.\n---\n\n## 🏗️ Project Structure\nThe project is organized into the following package structure:  \n```bash\nredis-subscriber-lettuce/\n│── src/main/java/com/yoanesber/spring/redis_subscriber_lettuce/\n│   ├── 📂config/                # Configuration classes for Redis\n│   ├── 📂event/                 # Redis event listeners\n│   ├── 📂service/               # Business logic layer\n│   │   ├── 📂impl/              # Implementation of services\n```\n---\n\n## ⚙ Environment Configuration\nConfiguration values are stored in `.env.development` and referenced in `application.properties`.  \nExample `.env.development` file content:  \n```properties\n# Application properties\nAPP_PORT=8081\nSPRING_PROFILES_ACTIVE=development\n\n# Redis properties\nREDIS_HOST=localhost\nREDIS_PORT=6379\nREDIS_USERNAME=default\nREDIS_PASSWORD=your_password\nREDIS_TIMEOUT=5\nREDIS_CONNECT_TIMEOUT=3\nREDIS_LETTUCE_SHUTDOWN_TIMEOUT=10\n```\n\nExample `application.properties` file content:  \n```properties\n# Application properties\nspring.application.name=redis-publisher-lettuce\nserver.port=${APP_PORT}\nspring.profiles.active=${SPRING_PROFILES_ACTIVE}\n\n# Redis properties\nspring.data.redis.host=${REDIS_HOST}\nspring.data.redis.port=${REDIS_PORT}\nspring.data.redis.username=${REDIS_USERNAME}\nspring.data.redis.password=${REDIS_PASSWORD}\nspring.data.redis.timeout=${REDIS_TIMEOUT}\nspring.data.redis.connect-timeout=${REDIS_CONNECT_TIMEOUT}\nspring.data.redis.lettuce.shutdown-timeout=${REDIS_LETTUCE_SHUTDOWN_TIMEOUT}\n```\n---\n\n## 🛠️ Installation \u0026 Setup\nA step by step series of examples that tell you how to get a development env running.  \n1. Clone the repository\n```bash\ngit clone https://github.com/yoanesber/Spring-Boot-Redis-Subscriber-Lettuce.git\ncd Spring-Boot-Redis-Subscriber-Lettuce\n```\n\n2. Ensure Redis is installed and running:\n```bash\nredis-server\n```\n\n3. (Optional) If you want to add a specific user with access to a specific channel, you can run the following command in Redis CLI:\n```bash\nACL SETUSER your_user +CHANNEL~your_channel on \u003eyour_password\n```\n\n4. Set up Redis user and password in `.env.development` file:\n```properties\n# Redis properties\nREDIS_PASSWORD=your_password\n```\n\n5. Build and run the application\n```bash\nmvn spring-boot:run\n```\n\n6. Verify Redis Subscription Use Redis CLI to publish a message:\n```bash\nredis-cli\nPUBLISH PAYMENT_SUCCESS \"{\\\"event\\\":\\\"PAYMENT_SUCCESS\\\",\\\"message\\\":{\\\"id\\\":\\\"1\\\",\\\"orderId\\\":\\\"ORD123456789\\\",\\\"amount\\\":199.99,\\\"currency\\\":\\\"USD\\\",\\\"paymentMethod\\\":\\\"PAYPAL\\\",\\\"paymentStatus\\\":\\\"SUCCESS\\\",\\\"cardNumber\\\":null,\\\"cardExpiry\\\":null,\\\"cardCvv\\\":null,\\\"paypalEmail\\\":\\\"my@email.com\\\",\\\"bankAccount\\\":null,\\\"bankName\\\":null,\\\"transactionId\\\":\\\"TXN1742316764298\\\",\\\"retryCount\\\":0,\\\"createdAt\\\":\\\"2025-03-18T16:52:44.298336Z\\\",\\\"updatedAt\\\":\\\"2025-03-18T16:52:44.298336Z\\\"}}\"\n```\n---\n\n## 🔗 Related Repositories\n- For the Redis Publisher implementation, check out [Spring Boot Redis Publisher with Lettuce](https://github.com/yoanesber/Spring-Boot-Redis-Publisher-Lettuce).\n- For the Redis Stream as Message Producer implementation, check out [Order Payment Service with Redis Streams as Reliable Message Producer for PAYMENT_SUCCESS / PAYMENT_FAILED Events](https://github.com/yoanesber/Spring-Boot-Redis-Stream-Producer).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoanesber%2Fspring-boot-redis-subscriber-lettuce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoanesber%2Fspring-boot-redis-subscriber-lettuce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoanesber%2Fspring-boot-redis-subscriber-lettuce/lists"}