https://github.com/linux-china/spring-cloud-function-demo
Spring cloud function with RSocket
https://github.com/linux-china/spring-cloud-function-demo
r2dbc rsocket spring-boot spring-cloud-function
Last synced: 5 months ago
JSON representation
Spring cloud function with RSocket
- Host: GitHub
- URL: https://github.com/linux-china/spring-cloud-function-demo
- Owner: linux-china
- Created: 2019-11-20T09:39:44.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-08T14:46:13.000Z (almost 3 years ago)
- Last Synced: 2025-04-02T02:51:14.468Z (11 months ago)
- Topics: r2dbc, rsocket, spring-boot, spring-cloud-function
- Language: Java
- Size: 66.4 KB
- Stars: 24
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Spring Cloud Function with RSocket
==================================
Expose cloud function with REST API & RSocket with R2DBC as backend.
# Function signatures
* RPC: Function>, Function, Mono>
```
public Function uppercase() {
return value -> value.toUpperCase();
}
public Function, Flux> reactiveUpperCase() {
return flux -> flux.map(val -> val.toUpperCase());
}
```
* request/stream: Function>
* fire_and_forget/metadataPush: Function
```
public Consumer log() {
return person -> {
System.out.println("Received: " + person);
};
}
public Function, Mono> log() {
return flux -> flux.map(..).filter(..).then();
}
```
* channel: Function>, Flux
# Demo function
```java
@Controller
public class Greeter implements Function> {
@Override
@MessageMapping("greeter")
public Mono apply(String name) {
return Mono.just("Hello " + name);
}
}
```
# References
* Spring Cloud Function: https://spring.io/projects/spring-cloud-function
* Spring Cloud Function Docs: https://cloud.spring.io/spring-cloud-static/spring-cloud-function/3.0.0.RELEASE/reference/html/index.html
* spring-cloud-function-rsocket: https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-rsocket
* Spring Data R2DBC: https://spring.io/projects/spring-data-r2dbc
* Event-Driven with Spring Cloud Function and Spring Cloud Stream: https://learning.oreilly.com/videos/event-driven-with-spring/10000MNLV2021128/
* spring-cloud-function-grpc: https://github.com/spring-cloud/spring-cloud-function/tree/main/spring-cloud-function-adapters/spring-cloud-function-grpc
* Functions and Spring Cloud Stream Applications for data driven microservices: https://github.com/spring-cloud/stream-applications