RESTful web service – JAX-RS and CDI

Now, it's time to build our RESTful web service implementation, as follows:

  1. Delete the default implementation class, HelloWorldEndpoint.java, created by the Thorntail generator.
  2. Define a new package, named service (the fully qualified name will be com.packtpub.thorntail.footballplayermicroservice.rest.service), where we will put the RESTful web service implementation.
  3. Finally, let's build the API implementations by using the CDI specifications (in order to inject the entity manager used to manage database connections) and the JAX-RS (in order to implement the RESTful operations). We will create an AbstractFacade class that defines the standard CRUD of our microservice:
package com.packtpub.thorntail.footballplayermicroservice.rest.service; ...

Get Hands-On Cloud-Native Microservices with Jakarta EE now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.