BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News MicroProfile 3.0: Updated Rest Client + Metrics 2.0 and Health Check 2.0

MicroProfile 3.0: Updated Rest Client + Metrics 2.0 and Health Check 2.0

Lire ce contenu en français

Bookmarks

Eclipse MicroProfile 3.0 was recently released with updates to its Rest Client, Metrics, and Health Check APIs. MicroProfile 3.0 leverages Java EE 8 as its foundation for the development of Java microservices.

The image below shows the components of MicroProfile 3.0; the blue squares representing updates for the 3.0 release.

MicroProfile 3.0

Changes in Metrics and Health Check are not backward compatible, so plan your upgrades accordingly.

Philip Riecks blogged about this release in #REVIEW: What’s new in MicroProfile 3.0. He notes that Metrics 2.0 contains a refactoring of Counters, immutable Metadata, a MetricID unique identifier, and tags are now appended to GET requests.

For Health Check 2.0, Riecks mentions that the health check response removed outcome and state in favor of status. Liveness and readiness endpoints have been added for smoother Kubernetes integration too.

Rest Client 1.3 is not a major release and contains improvements to configuration and security. From Rieck's blog:

  • Spec-defined SSL support via new RestClientBuilder methods and MP Config properties.
  • Allow client proxies to be cast to Closeable/AutoCloseable.
  • Simpler configuration using configKeys.
  • Defined application/json to be the default MediaType if none is specified in @Produces/@Consumes.

At the time of this writing, no MicroProfile runtimes support MicroProfile 3.0. You can see a matrix of MicroProfile releases and server support on Eclipsepedia's MicroProfile/Implementation page.

Boost for MicroProfile

In other MicroProfile news, the Open Liberty team has been prototyping a "Boost" plugin. This plugin is designed to work with Maven or Gradle and allows you to develop your MicroProfile app without tying it to a specific implementation. When using Boost, you add "booster" dependencies to your pom.xml:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>boost.boosters</groupId>
            <artifactId>mp20-bom</artifactId>
            <version>0.1.3-SNAPSHOT</version>
            <scope>import</scope>
            <type>pom</type>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>
    <!-- Boosters -->
    <dependency>
        <groupId>boost.boosters</groupId>
        <artifactId>mpConfig</artifactId>
    </dependency>
    <dependency>
        <groupId>boost.boosters</groupId>
        <artifactId>mpRestClient</artifactId>
    </dependency>
    <dependency>
        <groupId>boost.boosters</groupId>
        <artifactId>jpa</artifactId>
    </dependency>
</dependencies>

The runtime chosen is selected based on your dependencies.

<!-- Runtime -->
<dependency>
    <groupId>boost.runtimes</groupId>
    <artifactId>openliberty</artifactId>
</dependency>

<!--  Switch runtime by switching dependencies
<dependency>
    <groupId>boost.runtimes</groupId>
    <artifactId>tomee</artifactId>
</dependency>
-->

You can also choose your database based on dependencies. If the MicroProfile community adopts this plugin, it should work well with the MicroProfile Starter, which InfoQ covered in MicroProfile Community Launches MicroProfile Starter, a Web-Based Project Generator.

NOTE: In our previous post, we noted that the MicroProfile Starter did not have a REST API. That feature has since been added. See this issue for more information.

Rate this Article

Adoption
Style

BT