Getting started with the MicroProfile API

The Java Enterprise API is a great set of technologies for building applications, but it has historically lacked some features that are needed if you want to move your application to the cloud. For instance, there is no specific API to handle configuration properties that can be injected into your services, nor is there a formal way to describe how clients can interact with REST endpoints. Also, it would definitely help to include some features so that we can monitor an application's health or load-balance requests; these are currently managed by vendors with custom technologies.

The Eclipse MicroProfile project is a collaboration initiative that's driven by top application vendors and aims to optimize the Enterprise API for Java applications, including all the features we have mentioned here.

A bird's-eye view of the Eclipse MicroProfile specification shows how rich this environment is in the 3.2 release:

In this chapter, we will delve into the following areas of the MicroProfile specification:

  • The Eclipse MicroProfile Configuration: Provides a unified way to configure your services by injecting the configuration data from a static file or from environment variables.
  • The Eclipse MicroProfile Health Check: Provides the ability to probe the state of a service; for example, whether it's running or not, whether it lacks disk space, or whether there is an issue with the database connection.
  • The Eclipse MicroProfile Fault Tolerance: Allows you to define a strategy in the event of your services failing, for example, configuring timeouts, retry policies, fallback methods, and Circuit Breaker processing.
  • The Eclipse MicroProfile Metrics: Provides a standard way for MicroProfile services to export monitoring data to external agents. Metrics also provide a common Java API that exposes their telemetry data.
  • The Eclipse MicroProfile OpenAPI: Provides a set of Java interfaces to document your services in a standard way.
  • The Eclipse MicroProfile OpenTracing: Provides a set of instrumentation libraries for tracing components such as JAX-RS and CDI.
  • The Eclipse MicroProfile Rest Client: This builds upon the JAX-RS API and provides a type safe, unified approach for invoking RESTful services over HTTP.

Although not discussed in this chapter, Quarkus also supports MicroProfile JWT RBAC, which outlines a proposal for using OpenID Connect (OIDC)-based JSON Web Tokens (JWTs) for role-based access control (RBAC) in your service endpoints. In the next chapter, which is about security, we will cover this topic in more detail.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.152.157