{"id":15043547,"url":"https://github.com/guoshiqiufeng/spring-cloud-stream-redis","last_synced_at":"2025-10-04T17:50:55.152Z","repository":{"id":255990454,"uuid":"849763875","full_name":"guoshiqiufeng/spring-cloud-stream-redis","owner":"guoshiqiufeng","description":"spring cloud stream for redis","archived":false,"fork":false,"pushed_at":"2025-01-05T02:33:54.000Z","size":284,"stargazers_count":4,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-02T06:34:15.579Z","etag":null,"topics":["messaging","redis","spring-cloud-stream","spring-cloud-stream-redis"],"latest_commit_sha":null,"homepage":"https://guoshiqiufeng.github.io/spring-cloud-stream-redis","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/guoshiqiufeng.png","metadata":{"files":{"readme":"README-zh.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,"zenodo":null}},"created_at":"2024-08-30T07:45:24.000Z","updated_at":"2025-07-11T03:03:21.000Z","dependencies_parsed_at":"2024-09-08T11:56:03.809Z","dependency_job_id":"1cf70b0b-4530-4f1b-8351-a1d574c02edc","html_url":"https://github.com/guoshiqiufeng/spring-cloud-stream-redis","commit_stats":null,"previous_names":["guoshiqiufeng/spring-cloud-stream-redis"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/guoshiqiufeng/spring-cloud-stream-redis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guoshiqiufeng%2Fspring-cloud-stream-redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guoshiqiufeng%2Fspring-cloud-stream-redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guoshiqiufeng%2Fspring-cloud-stream-redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guoshiqiufeng%2Fspring-cloud-stream-redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guoshiqiufeng","download_url":"https://codeload.github.com/guoshiqiufeng/spring-cloud-stream-redis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guoshiqiufeng%2Fspring-cloud-stream-redis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278350959,"owners_count":25972675,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["messaging","redis","spring-cloud-stream","spring-cloud-stream-redis"],"created_at":"2024-09-24T20:49:15.066Z","updated_at":"2025-10-04T17:50:55.079Z","avatar_url":"https://github.com/guoshiqiufeng.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## spring-cloud-stream-redis\n\n[![Maven central](https://img.shields.io/maven-central/v/io.github.guoshiqiufeng.cloud/spring-cloud-starter-stream-redis.svg?style=flat-square)](https://search.maven.org/search?q=g:io.github.guoshiqiufeng.cloud%20AND%20a:spring-cloud-starter-stream-redis)\n[![License](https://img.shields.io/:license-apache-brightgreen.svg?style=flat-square)](http://www.apache.org/licenses/LICENSE-2.0.html)\n[![CodeQL](https://github.com/guoshiqiufeng/spring-cloud-stream-redis/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/guoshiqiufeng/spring-cloud-stream-redis/actions/workflows/github-code-scanning/codeql)\n\n阅读其他语言版本: [English](README.md)\n\n### 介绍\n\n基于Spring Cloud Stream 规范实现 Redis 消息 发送、接收， 正式版本 与 Spring Cloud Stream 保持一致\n\n### 文档\n\nhttps://guoshiqiufeng.github.io/spring-cloud-stream-redis/\n\n### 开发框架\n\n- Spring Cloud Stream 4\n- Spring Boot 3\n\n### 功能\n\n- PUBLISH SUBSCRIBE 消息\n- QUEUE 消息（BLPOP BRPOP LPUSH RPUSH）\n\n\u003e 注1： 两个功能模式不能混合使用，即 使用 PUBLISH SUBSCRIBE 模式 发送消息 时，不能使用 QUEUE 模式接收消息，反之亦然\n\n\u003e 注2： PUBLISH SUBSCRIBE 模式消息接收不到会丢失，QUEUE 模式不会\n\n### 使用\n\n#### 引入统一版本依赖，不用再使用时指定版本号\n\n```xml\n\n\u003cdependencyManagement\u003e\n    \u003cdependencies\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003eio.github.guoshiqiufeng.cloud\u003c/groupId\u003e\n            \u003cartifactId\u003espring-cloud-stream-dependencies\u003c/artifactId\u003e\n            \u003cversion\u003e0.5.2\u003c/version\u003e\n            \u003ctype\u003eimport\u003c/type\u003e\n        \u003c/dependency\u003e\n    \u003c/dependencies\u003e\n\u003c/dependencyManagement\u003e\n```\n\n#### 引入starter依赖\n\n```xml\n\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.github.guoshiqiufeng.cloud\u003c/groupId\u003e\n    \u003cartifactId\u003espring-cloud-starter-stream-redis\u003c/artifactId\u003e\n\u003c/dependency\u003e\n```\n\n#### yml 配置\n\n```yaml\nspring:\n  cloud:\n    function:\n      definition: send;recall\n    stream:\n      default-binder: redis\n      binders:\n        redis:\n          type: redis\n      redis:\n        binder:\n          configuration:\n            host: 127.0.0.1\n            port: 6379\n            password: 123456\n            database: 7\n          support-type: queue_channel\n      #        bindings:\n      #          send-in-0:\n      #            consumer:\n      #              destination-is-pattern: true\n      bindings:\n        out-0:\n          destination: test-topic\n          content-type: text/plain\n          group: push-producer-group\n        send-in-0:\n          destination: test-topic\n          content-type: text/plain\n          group: test-send-group\n```\n\n#### 消息发送\n\n```java\n\n@Autowired\nprivate StreamBridge streamBridge;\n\n@GetMapping(\"/send\")\npublic String send() {\n    MessageVO messageVO = new MessageVO();\n    messageVO.setKey(UUID.randomUUID().toString());\n    messageVO.setMsg(\"hello \");\n    messageVO.setIds(Set.of(\"1\", \"2\"));\n    messageVO.setCreateTime(LocalDateTime.now());\n    streamBridge.send(\"out-0\", JSON.toJSONString(messageVO, JSONWriter.Feature.WriteClassName));\n    return \"success\";\n}\n```\n\n### 消息接收\n\n```java\n\n@Slf4j\n@Component(\"send\")\npublic class MessageHandler implements Consumer\u003cMessage\u003cString\u003e\u003e {\n\n    /**\n     * Performs this operation on the given argument.\n     *\n     * @param messageVOMessage the input argument\n     */\n    @Override\n    public void accept(Message\u003cString\u003e messageVOMessage) {\n        log.info(\"send Receive New Messages: {}\", messageVOMessage.getPayload());\n    }\n}\n```\n\n更多使用参考查看[文档](https://guoshiqiufeng.github.io/spring-cloud-stream-redis/zh/)\n\n更多示例 查看 [spring-cloud-stream-redis-samples](https://github.com/guoshiqiufeng/spring-cloud-stream-redis-samples)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguoshiqiufeng%2Fspring-cloud-stream-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguoshiqiufeng%2Fspring-cloud-stream-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguoshiqiufeng%2Fspring-cloud-stream-redis/lists"}