Chapter 6. Enable Eclipse MicroProfile application development for JBoss EAP on Red Hat CodeReady Studio

If you want to incorporate Eclipse MicroProfile capabilities in applications that you develop on CodeReady Studio, you must enable Eclipse MicroProfile support for JBoss EAP in CodeReady Studio.

JBoss EAP expansion packs provide support for Eclipse MicroProfile.

JBoss EAP expansion packs are not supported on JBoss EAP 7.2 and earlier.

Each version of the JBoss EAP expansion pack supports specific patches of JBoss EAP. For details, see the JBoss EAP expansion pack Support and Life Cycle Policies page.

Important

The JBoss EAP XP Quickstarts for Openshift are provided as Technology Preview only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs), might not be functionally complete, and Red Hat does not recommend to use them for production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.

See Technology Preview Features Support Scope on the Red Hat Customer Portal for information about the support scope for Technology Preview features.

6.1. Installing the JBoss EAP XP in CodeReady Studio

You must install the JBoss EAP XP in CodeReady Studio to make the Eclipse MicroProfile capabilities available for application development.

Note

JBoss EAP expansion packs are not supported on JBoss EAP 7.2 and earlier.

Prerequisites

  • Set up JBoss EAP 7.3 on CodeReady Studio.
  • Download the following software artifacts:

    • The appropriate JBoss EAP 7.3 patch. See the Red Hat JBoss Enterprise Application Platform expansion pack Support and Life Cycle Policies page for information about the correct patches of JBoss EAP and JBoss EAP XP to install.
    • JBoss EAP XP manager.
    • The appropriate JBoss EAP XP patch. See the Red Hat JBoss Enterprise Application Platform expansion pack Support and Life Cycle Policies page for information about the correct patches of JBoss EAP and JBoss EAP XP to install.

Procedure

  1. Navigate to the JBoss EAP installation directory that you specified when installing JBoss EAP through CodeReady Studio.
  2. Apply the JBoss EAP patch that you downloaded earlier.

    $ patch apply /_DOWNLOAD_/_PATH_/jboss-eap-<patch_id>-patch.zip

    For example:

    $ patch apply /_DOWNLOAD_/_PATH_/jboss-eap-7.3.1-patch.zip
  3. Set up JBoss EAP XP manager in your CodeReady Studio installation of JBoss EAP.

    $ java -jar jboss-eap-xp-<patch_id>-manager.jar setup --jboss-home=/_PATH_/_TO_/_EAP_

    For example:

    $ java -jar jboss-eap-xp-1.0.0.GA-CR1-manager.jar setup --jboss-home=/_PATH_/_TO_/_EAP_
  4. Apply the JBoss EAP XP patch that you downloaded.

    $ patch apply /_DOWNLOAD_/_PATH_/jboss-eap-xp-<patch_id>-patch.zip

    For example:

    $ patch apply /_DOWNLOAD_/_PATH_/jboss-eap-xp-1.0.0.GA-patch.zip

6.2. Configuring CodeReady Studio to use Eclipse MicroProfile capabilities

To enable Eclipse MicroProfile support on JBoss EAP, register a new runtime server for JBoss EAP XP, and then create the new JBoss EAP 7.3 server.

Give the server an appropriate name that helps you recognize that it supports Eclipse MicroProfile capabilities.

This server uses a newly created JBoss EAP XP runtime that points to the runtime installed previously and uses the standalone-microprofile.xml configuration file.

Procedure

  1. Set up the new server on the New Server dialog box.

    1. In the Select server type list, select Red Hat JBoss Enterprise Application Platform 7.3.
    2. In the Server’s host name field, enter localhost.
    3. In the Server name field, enter JBoss EAP 7.3 XP.
    4. Click Next.
  2. Configure the new server.

    1. In the Home directory field, if you do not want to use the default setting, specify a new directory; for example: home/myname/dev/microprofile/runtimes/jboss-eap-7.3.
    2. Make sure the Execution Environment is set to JavaSE-1.8.
    3. Optional: Change the values in the Server base directory and Configuration file fields.
    4. Click Finish.

Result

You are now ready to begin developing applications using Eclipse MicroProfile capabilities, or to begin using the Eclipse MicroProfile quickstarts for JBoss EAP.

6.3. Using Eclipse MicroProfile quickstarts for CodeReady Studio

Enabling the Eclipse MicroProfile quickstarts makes the simple examples available to run and test on your installed server.

These examples illustrate the following Eclipse MicroProfile capabilities.

  • Eclipse MicroProfile Config
  • Eclipse MicroProfile Fault Tolerance
  • Eclipse MicroProfile Health
  • Eclipse MicroProfile JWT
  • Eclipse MicroProfile Metrics
  • Eclipse MicroProfile OpenAPI
  • Eclipse MicroProfile OpenTracing
  • Eclipse MicroProfile REST Client

Procedure

  1. Import the pom.xml file from the Quickstart Parent Artifact.
  2. If the quickstart you are using requires environment variables, configure the environment variables.

    Define environment variables on the launch configuration on the server Overview dialog box.

    For example, the microprofile-opentracing quickstart uses the following environment variables:

    • JAEGER_REPORTER_LOG_SPANS set to true
    • JAEGER_SAMPLER_PARAM set to 1
    • JAEGER_SAMPLER_TYPE set to const

Additional resources

About Eclipse Microprofile

About JBoss Enterprise Application Platform expansion pack

Red Hat JBoss Enterprise Application Platform expansion pack Support and Life Cycle Policies