Skip to content

Commit ece37e5

Browse files
authored
Update README.md
1 parent a9989d5 commit ece37e5

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,26 @@
33
This project is a reactive web server template, using webflux + reactive-mongo as basic framework, a template for efficiently dealing with highly concurrent requests.
44

55
Servers bases on this template from my own have `7000+` throughput under `10000+` concurrency with `1s` response time in average via pressure test by Jmeter.
6+
7+
### Usage
8+
The most important class was `com.toocol.common.web.AbstractHttpAction`, one HttpAction represent one http request handler, and add annotation `com.toocol.common.web.ActionMapping` to register http uri mapping. For example:
9+
```java
10+
@Slf4j
11+
@AllArgsConstructor
12+
// uri is represent to "/article/add_article"
13+
@ActionMapping(module = "article", action = "add_article")
14+
public class AddArticleAction extends AbstractHttpAction<String> implements IVessel {
15+
16+
@Override
17+
public Mono<String> action(JSONObject param) throws Exception {
18+
ArticleAddress articleAddress = ArticleAddress.builder()
19+
.digest(UUID.randomUUID().toString())
20+
.url("https://www.guitarcs.article/1001")
21+
.build();
22+
23+
return vessel().articleAddressRepo.insert(articleAddress)
24+
.thenReturn("Success");
25+
}
26+
27+
}
28+
```

0 commit comments

Comments
 (0)