Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

A composition of reactive technologies in action

Pragya Keshap answered on February 19, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers

  • What’s reactive programming?
  • Features of Reactive Programming

  • A composition of reactive technologies in action

    0

    The key is as follows:

    This is the NewsServiceApp class declaration. This class is annotated with the @SpringBootApplication annotation, which assumes the usage of Spring Boot features. In turn, there is an additional @EnableRatpack annotation at point (1.1) which is part of the ratpack-spring-boot module and enables auto-configuration for the Ratpack server.

    This is the common beans declaration. Here, at point (2.1) we configure the MongoClient bean. At points (2.2) and (2.3) there are configurations of services for news retrieval and lookup.

    This is the request's handler declaration. Here, to create a Ratpack request handler, we have to declare a Bean with the Action type, which allows providing the configuration of the handler at point (3.1).

    This is the services invocation and results aggregation. Here we execute the services' methods and merge the returned streams using Ratpack Streams API (4.1).

    This is the rendering of the merged streams stage. Here, we asynchronously reduce all the elements into a list and then transform that list to the specific rendering view such as JSON (5.1).

    This is the main method's implementation. Here we use a common technique for bringing the Spring Boot application to life.

    Popularity 1/10 Helpfulness 1/10 Language java
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Feb 19 2023
    Pragya Keshap
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.