The JAX-RS API also has some great features for event-driven programming. This recipe will show you can use an async invoker from the request to write responses through callbacks.
Building reactive applications using JAX-RS
Getting ready
Let's first add our Java EE 8 dependency:
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>8.0</version>
<scope>provided</scope>
</dependency>
How to do it...
- First, we create a User POJO:
public class...