https://github.com/arnozhang/morpc
A simple Rpc framework.
https://github.com/arnozhang/morpc
registry rpc spring springboot
Last synced: about 1 year ago
JSON representation
A simple Rpc framework.
- Host: GitHub
- URL: https://github.com/arnozhang/morpc
- Owner: arnozhang
- License: mit
- Created: 2020-10-14T09:29:40.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-10-18T09:47:09.000Z (over 5 years ago)
- Last Synced: 2025-01-18T09:38:35.747Z (about 1 year ago)
- Topics: registry, rpc, spring, springboot
- Language: Java
- Homepage:
- Size: 42 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# morpc
> A simple Rpc framework.
## 1. Run Demo
1. run `mvn install`
2. start registry center: demos/morpc-registry-center-demo
3. start service: demos/morpc-service-demo
4. start reference: demos/morpc-reference-demo
5. test rpc: [http://localhost:8080/test?message=world](http://localhost:8080/test?message=world)
## 2. Usage
### 2.1. Declare Rpc Service
```java
public interface DemoHelloService {
String sayHello(String message);
}
@MoService
@Service
public class DemoHelloServiceImpl implements DemoHelloService {
@Override
public String sayHello(String message) {
return "hello " + message;
}
}
```
### 2.2. Rpc Reference
```java
@RestController
public class TestController {
@MoReference
private DemoHelloService demoHelloService;
@GetMapping("/test")
public String test() {
return demoHelloService.sayHello("world");
}
}
```