Need help with ReactiveLab?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

202 Stars 72 Forks Apache License 2.0 119 Commits 4 Opened issues


Experiments and prototypes with reactive application design.

Services available


Need anything else?

Contributors list


Experiments and prototypes with reactive application design using service-oriented architecture concepts.


Start discovery server using

./gradlew startDiscovery


Start gateway server using or Gradle:

./gradlew startGateway


Simulation of middle-tier RPC/RESTful services exposing endpoints over HTTP.

Start several services on different ports using or Gradle:

./gradlew startServices


See how Netty and RxJava are used as an HTTP server in GatewayServer

Basics are:

        RxNetty.createHttpServer(8080, (request, response) -> {
            System.out.println("Server => Request: " + request.getPath());
            ... handle requests here ...


Clients using Netty and RxJava can be seen in the clients package.

Basic example:

        return RxNetty.createHttpClient("localhost", 9100)
                .submit(HttpClientRequest.createGet("/mock.json?id=" + id));


Here is a batch request using SSE inside a

for fault-tolerance: BookmarksCommand.


can be put in front of that command to allow automated batching: BookmarkCommand.


Nested, parallel execution of network requests can be composed using RxJava and Hystrix as demonstrated in RouteForDeviceHome which is the example running at the


Here is a portion of the code to show the composition:

        return new UserCommand(userId).observe().flatMap(user -> {
            Observable> catalog = new PersonalizedCatalogCommand(user).observe()
                    .flatMap(catalogList -> {
                        return catalogList.videos().> flatMap(video -> {
                            Observable bookmark = new BookmarkCommand(video).observe();
                            Observable rating = new RatingsCommand(video).observe();
                            Observable metadata = new VideoMetadataCommand(video).observe();
                            return, rating, metadata, (b, r, m) -> {
                                return combineVideoData(video, b, r, m);

        Observable<map object>&gt; social = new SocialCommand(user).observe().map(s -&gt; {
            return s.getDataAsMap();

        return Observable.merge(catalog, social);
    }).flatMap(data -&gt; {
        return response.writeAndFlush(new ServerSentEvent("", "data", SimpleJson.mapToJson(data)), EdgeServer.SSE_TRANSFORMER);

This results in 7 network calls being made, and multiple bookmark requests are automatically collapsed into 1 network call. Here is the

that results from the code above being executed:
Server => Hystrix Log [/device/home] => UserCommand[SUCCESS][191ms], PersonalizedCatalogCommand[SUCCESS][50ms], SocialCommand[SUCCESS][53ms], RatingsCommand[SUCCESS][65ms]x6, VideoMetadataCommand[SUCCESS][73ms]x6, BookmarksCommand[SUCCESS, COLLAPSED][25ms], BookmarksCommand[SUCCESS, COLLAPSED][24ms]

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.