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

Returning data reactively to an API controller

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

Contents


More Related Answers

  • spring data rest partial update
  • adding 2 get methods in controller web api
  • single data class value api respone
  • Reactive Streams API
  • Reactive Streams API
  • Exposing Reactive Restful APIs ( all the GET / POST / PUT / DELETE )
  • Serving data with a reactive GET method
  • Reactive APIs
  • Testing Reactive APIs
  • Why do we use ResponseEntity in a RESTful Service?
  • webApi return types

  • Returning data reactively to an API controller

    0

    @RestController: Spring’s annotation to signal that this class doesn’t process templates but instead that all outputs are directly serialized to the HTML response

    EmployeeRepository: We are injecting the repository we defined earlier in this section through constructor injection

    @GetMapping: Maps HTTP GET /api/employees calls to this method

    Flux: Indicates that this returns one (or more) Employee records

    repository.findAll(): By using the prebuilt findAll method from Spring Data Commons’ ReactiveCrudRepository interface, we already have a method that will fetch all the data

    Popularity 2/10 Helpfulness 1/10 Language java
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Feb 15 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.