[go: nahoru, domu]

Skip to content
/ reactive-server Public template

Reactive web server template, using Webflux + Reactive-Mongodb as basic framework, a template for efficiently dealing with highly concurrent requests.

Notifications You must be signed in to change notification settings

Joezeo/reactive-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

reactive_server

This project is a reactive web server template, using webflux + reactive-mongo as basic framework, a template for efficiently dealing with highly concurrent requests.

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.

Usage

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:

@Slf4j
@AllArgsConstructor
// uri is represent to "/article/add_article"
@ActionMapping(module = "article", action = "add_article")
public class AddArticleAction extends AbstractHttpAction<String> implements IVessel {

    @Override
    public Mono<String> action(JSONObject param) throws Exception {
        ArticleAddress articleAddress = ArticleAddress.builder()
                .digest(UUID.randomUUID().toString())
                .url("https://www.guitarcs.article/1001")
                .build();
                
        return vessel().articleAddressRepo.insert(articleAddress)
                .thenReturn("Success");
    }

}

About

Reactive web server template, using Webflux + Reactive-Mongodb as basic framework, a template for efficiently dealing with highly concurrent requests.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages