{"id":22567770,"url":"https://github.com/jihongkim98/redis-extensions","last_synced_at":"2025-06-14T18:08:11.545Z","repository":{"id":265358116,"uuid":"895619369","full_name":"JiHongKim98/redis-extensions","owner":"JiHongKim98","description":"A lightweight annotation-based Redis Pub/Sub library for simplified subscription handling","archived":false,"fork":false,"pushed_at":"2024-12-05T03:08:32.000Z","size":74,"stargazers_count":22,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-05T00:21:54.700Z","etag":null,"topics":["annotations","data-redis","extension-module","redis","spring","spring-boot"],"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/JiHongKim98.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":"2024-11-28T14:48:17.000Z","updated_at":"2025-04-21T07:13:05.000Z","dependencies_parsed_at":"2025-04-10T12:37:01.943Z","dependency_job_id":"68a5a7f3-54d9-4b4b-a47b-501a18d88286","html_url":"https://github.com/JiHongKim98/redis-extensions","commit_stats":null,"previous_names":["jihongkim98/redis-extension","jihongkim98/redis-extensions"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/JiHongKim98/redis-extensions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JiHongKim98%2Fredis-extensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JiHongKim98%2Fredis-extensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JiHongKim98%2Fredis-extensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JiHongKim98%2Fredis-extensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JiHongKim98","download_url":"https://codeload.github.com/JiHongKim98/redis-extensions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JiHongKim98%2Fredis-extensions/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259860405,"owners_count":22922987,"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":["annotations","data-redis","extension-module","redis","spring","spring-boot"],"created_at":"2024-12-08T00:09:05.914Z","updated_at":"2025-06-14T18:08:11.519Z","avatar_url":"https://github.com/JiHongKim98.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Redis Extensions \u003cimg src=\"https://github.com/user-attachments/assets/0f4a3bef-e476-457b-9131-77fb45939c52?s=200\u0026v=4\" height = 100 align = left\u003e\n\n\u003e A lightweight annotation-based Redis Pub/Sub library for simplified subscription handling.\n\n![version 0.0.1](https://img.shields.io/badge/version-0.0.1-red?labelColor=black\u0026style=flat-square) ![minimum_jdk](https://img.shields.io/badge/minimum_jdk-17-white?labelColor=black\u0026style=flat-square)\n\n## Dependency\n\nEnsure you have added the Redis Extensions dependency to your `pom.xml` (Maven) or `build.gradle` (Gradle).\n\n**Maven:**\n\n```xml\n\u003c!-- pom.xml --\u003e\n\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.github.jihongkim98\u003c/groupId\u003e\n    \u003cartifactId\u003eredis-extensions\u003c/artifactId\u003e\n    \u003cversion\u003e0.0.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n**Gradle:**\n\n```groovy\n// build.gradle\n\ndependencies {\n    implementation 'io.github.jihongkim98:redis-extensions:0.0.1'\n}\n```\n\nSee [maven.org](https://central.sonatype.com/artifact/io.github.jihongkim98/redis-extensions/overview)\n\n## Usage\n\nTo use **Redis Extensions** in your Spring project, follow these steps:\n\n### Configure RedisMessageListenerContainer\n\nYou must register a `RedisMessageListenerContainer` as a Spring Bean in your configuration class.\nThis is required to enable Redis Pub/Sub message processing.\n\n```java\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.data.redis.connection.RedisConnectionFactory;\nimport org.springframework.data.redis.listener.RedisMessageListenerContainer;\n\n@Configuration\npublic class RedisConfig {\n\n    @Bean\n    public RedisMessageListenerContainer redisMessageListenerContainer(RedisConnectionFactory connectionFactory) {\n        RedisMessageListenerContainer container = new RedisMessageListenerContainer();\n        container.setConnectionFactory(connectionFactory);\n        return container;\n    }\n\n    // ...\n}\n```\n\n### Enable Redis Extensions\n\nUse the `@EnableRedisBroadcast` annotation in your configuration class to activate the Redis Extensions library.\n\n```java\nimport io.github.jihongkim98.redisextensions.EnableRedisBroadcast;\nimport org.springframework.context.annotation.Configuration;\n\n@Configuration\n@EnableRedisBroadcast\npublic class RedisExtensionConfig {\n}\n```\n\n### Example Usage\n\nAfter completing the configuration,\nyou can define methods annotated with `@RedisBroadcastListener` in your beans to handle Redis Pub/Sub messages.\n\n```java\nimport io.github.jihongkim98.redisextensions.annotation.RedisBroadcastListener;\nimport org.springframework.stereotype.Service;\n\n@Service\npublic class SomeHandler {\n\n    @RedisBroadcastListener(channels = \"channel:example\")\n    public void listener(String message) {\n        System.out.println(\"Received message: \" + message);\n    }\n}\n```\n\nThe above example demonstrates how you can use the `@RedisBroadcastListener` annotation to listen to messages published to a specific Redis channel (`channel:example`).\n\nBelow is an example of how to **publish messages** using Redis Pub/Sub to test the `SomeHandler` class\n\n```java\nimport org.springframework.data.redis.core.StringRedisTemplate;\nimport org.springframework.stereotype.Service;\n\n@Service\npublic class SomeBroadcastHandler {\n\n    private final StringRedisTemplate redisTemplate;\n\n    public void execute() {\n        redisTemplate.convertAndSend(\n                \"channel:example\",  // channel name\n                \"Hello World!\"      // message to be sent\n        );\n    }\n}\n```\n\nTo test the functionality:\n\n1. Execute the `execute()` method from the `SomeBroadcastHandler` class.\n   This method sends a message (`\"Hello World!\"`) to the Redis channel named `\"channel:example\"`.\n2. If everything is configured correctly, the `listener` method in the `SomeHandler` class will be triggered\n   automatically.\n3. You should see the following output in the console:\n   ```\n   Received message: Hello World!\n   ```\n   This confirms that the message was successfully published and received through the Redis Pub/Sub system.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjihongkim98%2Fredis-extensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjihongkim98%2Fredis-extensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjihongkim98%2Fredis-extensions/lists"}