RxJersey is RxJava extension for Jersey framework providing non-blocking Jax-RS server and client. RxJersey target is to handle large amount requests in small static set of threads, which is highly suitable for microservice applications.
Library uses Jersey 2 async support with @Suspended
and AsyncResponse
under the hood.
Note that Jersey 2.26+ support is not released yet, you can obtain it from JitPack
- RxJava Support
- RxJava 2 Support
- RxJava Proxy Client
- Async Request Interceptors
- Dropwizard bundle
- Futures support
- Vert.x integration
- Improved proxy client
compile "net.winterly.rxjersey:dropwizard:$rxJerseyVersion"
compile "net.winterly.rxjersey:rxjava-client:$rxJerseyVersion"
compile "net.winterly.rxjersey:rxjava-server:$rxJerseyVersion"
compile "net.winterly.rxjersey:rxjava2-client:$rxJerseyVersion"
compile "net.winterly.rxjersey:rxjava2-server:$rxJerseyVersion"
Most recent snapshot is available via JitPack
compile "com.github.alex-shpak.rx-jersey:dropwizard:$rxJerseyVersion"
compile "com.github.alex-shpak.rx-jersey:rxjava-client:$rxJerseyVersion"
compile "com.github.alex-shpak.rx-jersey:rxjava-server:$rxJerseyVersion"
compile "com.github.alex-shpak.rx-jersey:rxjava2-client:$rxJerseyVersion"
compile "com.github.alex-shpak.rx-jersey:rxjava2-server:$rxJerseyVersion"
@Path("/example/")
public class GithubResource {
@Remote("https://api.github.com/")
private GithubApi githubApi;
@GET
@Path("github")
public Single<GithubRepository> getRepository() {
return githubApi.getRepository("alex-shpak", "rx-jersey").toSingle();
}
}
@Path("/")
public interface GithubApi {
@GET
@Path("/repos/{user}/{repo}")
Observable<GithubRepository> getRepository(@PathParam("user") String username, @PathParam("repo") String repo);
}