{"id":18559134,"url":"https://github.com/linux-china/spring-cloud-function-demo","last_synced_at":"2025-09-06T02:43:21.839Z","repository":{"id":136596396,"uuid":"222902155","full_name":"linux-china/spring-cloud-function-demo","owner":"linux-china","description":"Spring cloud function with RSocket","archived":false,"fork":false,"pushed_at":"2023-04-08T14:46:13.000Z","size":68,"stargazers_count":24,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T02:51:14.468Z","etag":null,"topics":["r2dbc","rsocket","spring-boot","spring-cloud-function"],"latest_commit_sha":null,"homepage":null,"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/linux-china.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":"2019-11-20T09:39:44.000Z","updated_at":"2023-04-10T21:00:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"68e72f7b-6441-4f52-a469-571069fe9498","html_url":"https://github.com/linux-china/spring-cloud-function-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Fspring-cloud-function-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Fspring-cloud-function-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Fspring-cloud-function-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Fspring-cloud-function-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linux-china","download_url":"https://codeload.github.com/linux-china/spring-cloud-function-demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248144158,"owners_count":21054876,"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":["r2dbc","rsocket","spring-boot","spring-cloud-function"],"created_at":"2024-11-06T21:42:09.013Z","updated_at":"2025-04-10T02:30:40.143Z","avatar_url":"https://github.com/linux-china.png","language":"Java","readme":"Spring Cloud Function with RSocket\n==================================\n\nExpose cloud function with REST API \u0026 RSocket with R2DBC as backend.\n\n# Function signatures\n\n* RPC: Function\u003cString, Mono\u003cString\u003e\u003e, Function\u003cMono\u003cUser\u003e, Mono\u003cGreeting\u003e\u003e\n```\n\npublic Function\u003cString, String\u003e uppercase() {\n   return value -\u003e value.toUpperCase();\n}\n\npublic Function\u003cFlux\u003cString\u003e, Flux\u003cString\u003e\u003e reactiveUpperCase() {\n\treturn flux -\u003e flux.map(val -\u003e val.toUpperCase());\n}\n```\n* request/stream: Function\u003cString, Flux\u003cString\u003e\u003e\n* fire_and_forget/metadataPush: Function\u003cString, Void\u003e\n\n```\npublic Consumer\u003cPerson\u003e log() {\n    return person -\u003e {\n        System.out.println(\"Received: \" + person);\n    };\n}\n\t\npublic Function\u003cFlux\u003c?\u003e, Mono\u003cVoid\u003e\u003e log() {\n\treturn flux -\u003e flux.map(..).filter(..).then();\n}\n```\n\n* channel: Function\u003cFlux\u003cString\u003e\u003e, Flux\u003cString\u003e\n\n# Demo function\n\n```java\n@Controller\npublic class Greeter implements Function\u003cString, Mono\u003cString\u003e\u003e {\n\n    @Override\n    @MessageMapping(\"greeter\")\n    public Mono\u003cString\u003e apply(String name) {\n        return Mono.just(\"Hello \" + name);\n    }\n}\n```\n\n# References\n\n* Spring Cloud Function: https://spring.io/projects/spring-cloud-function\n* Spring Cloud Function Docs: https://cloud.spring.io/spring-cloud-static/spring-cloud-function/3.0.0.RELEASE/reference/html/index.html\n* spring-cloud-function-rsocket: https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-rsocket\n* Spring Data R2DBC: https://spring.io/projects/spring-data-r2dbc\n* Event-Driven with Spring Cloud Function and Spring Cloud Stream: https://learning.oreilly.com/videos/event-driven-with-spring/10000MNLV2021128/\n* spring-cloud-function-grpc: https://github.com/spring-cloud/spring-cloud-function/tree/main/spring-cloud-function-adapters/spring-cloud-function-grpc\n* Functions and Spring Cloud Stream Applications for data driven microservices: https://github.com/spring-cloud/stream-applications\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinux-china%2Fspring-cloud-function-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinux-china%2Fspring-cloud-function-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinux-china%2Fspring-cloud-function-demo/lists"}