private Observable<Void> handleRecommendationsBy(HttpServerRequest<ByteBuf> request, HttpServerResponse<ByteBuf> response) {
        System.out.println(format("HTTP request -> recommendations by multiple criteria: %s?%s", request.getPath(), request.getQueryString()));
        List<String> category = request.getQueryParameters().get("category");
        List<String> ageGroup = request.getQueryParameters().get("ageGroup");
        if (category.isEmpty() || ageGroup.isEmpty()) {
            response.setStatus(HttpResponseStatus.BAD_REQUEST);
            return response.close();
        }

        boolean any = false;
        StringBuilder builder = new StringBuilder();
        for (Movie movie : movies.values()) {
            if (movie.getCategory().equals(category.get(0)) && movie.getAgeGroup().equals(ageGroup.get(0))) {
                System.out.println("    returning: " + movie);
                builder.append(movie).append('\n');
                any = true;
            }
        }
        if (!any) {
            System.out.println("No movie matched the given criteria:");
            for (Movie movie : movies.values()) {
                System.out.print("    ");
                System.out.println(movie);
            }
        }

        ByteBuf byteBuf = UnpooledByteBufAllocator.DEFAULT.buffer();
        byteBuf.writeBytes(builder.toString().getBytes(Charset.defaultCharset()));

        response.write(byteBuf);
        return response.close();
    }
The client examples assume that the movie server runs on the default port 8080.

@author Tomasz Bak
ribbon-examples/src/main/java/com/netflix/ribbon/examples/rx/RxMovieServer.java