WebSphere Application Server & Liberty

 View Only

Everything you need to know about MicroProfile 4.0 with Open Liberty 21.0.0.3

By Emily Jiang posted Wed April 21, 2021 04:31 PM

  
The latest release of MicroProfile 4.0 aligns with Jakarta EE 8. MicroProfile 4.0 is a major release, which includes many component specification updates, listed below.

  • MicroProfile Config 2.0:  supports Config Profile, Config Properties, ConfigValue, variable replacement. Check out this blog for more details.
  • MicroProfile Fault Tolerance 3.0: Clarifies the scope of Bulkheads and CircuitBreakers per class per method and also utilise Metrics tags
  • MicroProfile Metrics 2.0: introduces new metrics values for existing SimpleTimer and Timer metrics. 
  • MicroProfile Health 3.0: removed the deprecated @Health qualifier; renamed HealthCheckResponseBuilder.state(Boolean UP) to HealthCheckResponseBuilder.status(Boolean UP)
  • MicroProfile Open Tracing 2.0: adopts OpenTracing API to version 0.33.0
  • MicroProfile Open API 2.0: introduced a few new annotations such as @SchemaProperty @RequestBodySchema @APIResponseSchema 
  • MicroProfile Rest Client 2.0: supports HTTP proxy servers, automatically following HTTP redirects, Server Sent Events, and additional configuration options for JSON-B providers and multiple query parameters. Check out this blog for more details.
  • MicroProfile JWT 1.2: supports specifying JWT token in a cookie, JWE, as well as other additional algorithm ES256. Refer to this blog for more details.
MicroProfile 4.0 implementation is now available in Open Liberty 21.0.0.3 and future releases.

To make use of MicroProfile 4.0 you must add the feature to both pom.xml and server.xml. Add the following Maven dependency to your pom.xml:

<dependency>
    <groupId>org.eclipse.microprofile</groupId>
    <artifactId>microprofile</artifactId>
    <version>4.0.1</version>
    <type>pom</type>
    <scope>provided</scope>
</dependency>

or, if you use Gradle:

dependencies {
    providedCompile 'org.eclipse.microprofile:microprofile:4.0.1'
}

Please note: you need to use the version 4.0.1 as the version 4.0 does not pull in any dependencies (see here for more details).

Also, make sure to configure your Liberty server with the microProfile-4.0 feature in the server.xml:

<server>
  <featureManager>
    <feature>microProfile-4.0</feature>
    <!-- ... -->
  </featureManager>
  <!-- ... -->
</server>
If you want to learn all of MicroProfile 4.0 updates, check out the overall MicroProfile 4.0 deep dive blog.














0 comments
14 views

Permalink