https://github.com/scalecube/getting-started
hello world examples of using scalecube to get started building high-speed reactive microservices
https://github.com/scalecube/getting-started
helloworld scalecube-services
Last synced: 23 days ago
JSON representation
hello world examples of using scalecube to get started building high-speed reactive microservices
- Host: GitHub
- URL: https://github.com/scalecube/getting-started
- Owner: scalecube
- Created: 2019-01-24T07:56:11.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-08T06:27:35.000Z (about 6 years ago)
- Last Synced: 2025-04-10T05:09:37.987Z (23 days ago)
- Topics: helloworld, scalecube-services
- Language: Java
- Homepage: http://scalecube.io
- Size: 23.4 KB
- Stars: 4
- Watchers: 9
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Getting started
1. define java service dsl using interface.
```java
@Service("greeting")
public interface GreetingService {
@ServiceMethod("once")
Mono sayHello(String name);
@ServiceMethod("many")
Flux sayHellos(String name);@ServiceMethod("timer")
Flux timerHello(String name);
}
```2. implement the service dsl.
```java
public class SimpleGreetingService implements GreetingService {@Override
public Mono sayHello(String name) {
return Mono.just("greeting to: "+ name);
}@Override
public Flux sayHellos(String name) {
return Flux.range(0, 3).map(i -> "greeting to: " + name + "-" + i);
}@Override
public Flux timerHello(String name) {
return Flux.interval(Duration.ofSeconds(1)).map(i -> "greeting to: " + name + "-" + i);
}
}
```3. running the service.
- RequestResponseMain
- RequestStreamMain
- GreetingServiceMain and ServiceGatewayMain4. Api-Sandbox:
4.1. open in browser: http://scalecube.io/api-sandbox/app/index.html4.2. click settings and choose Rsocket and set url ws://localhost:9090

4.3. input json request and click send:
select:

send:
