catalog.redhat.com Open in urlscan Pro
2a02:26f0:6c00::210:bab0  Public Scan

Submitted URL: http://registry.connect.redhat.com/
Effective URL: https://catalog.redhat.com/
Submission: On January 26 via manual from CO — Scanned from DE

Form analysis 1 forms found in the DOM

<form class="pf-c-form" style="margin-top:16px" id="ecoFeedbackForm"><input type="hidden" name="form_build_id" value="form-Se0bIPh-L26lbPDwUP218Z2oRfKjEYbIRvKBM4Eo1R8"> <input type="hidden" name="form_token"
    value="w3-skVyKDZSGJUXAawp-QF6jqc-WeSZqCxXqWnqMaBg"> <input type="hidden" name="form_id" value="rhec_feedback_entityform_edit_form">
  <div style="display:flex" class="mobile-stack">
    <div class="pf-c-form__group" style="flex:1;padding-right:16px"><label class="pf-c-form__label" for="field_eco_company[und][0][value]"><span class="pf-c-form__label-text">Your company/organization</span></label>
      <div class="pf-c-form__horizontal-group"><input class="pf-c-form-control" id="company" name="field_eco_company[und][0][value]"></div>
    </div>
    <div class="pf-c-form__group" style="flex:1"><label class="pf-c-form__label" for="field_eco_role[und][0][value]"><span class="pf-c-form__label-text">Your role</span></label>
      <div class="pf-c-form__horizontal-group"><select class="pf-c-form-control" style="padding-left:8px" id="role" name="field_eco_role[und][0][value]">
          <option value="">Select your role</option>
          <option value="Architect">Architect</option>
          <option value="Developer">Developer</option>
          <option value="DevOps Engineer">DevOps Engineer</option>
          <option value="Product Manager">Product Manager</option>
          <option value="Systems Administrator">Systems Administrator</option>
          <option value="Other">Other</option>
        </select></div>
    </div>
  </div>
  <div class="pf-c-form__group"><label class="pf-c-form__label" for="field_eco_what_is_working_well[und][0][value]"><span class="pf-c-form__label-text">What is working well?</span></label>
    <div class="pf-c-form__horizontal-group"><textarea class="pf-c-form-control" type="text" id="workingWell" name="field_eco_what_is_working_well[und][0][value]" aria-label="textarea example"></textarea></div>
  </div>
  <div class="pf-c-form__group"><label class="pf-c-form__label" for="field_eco_how_can_we_improve[und][0][value]"><span class="pf-c-form__label-text">How can we continue to improve?</span></label>
    <div class="pf-c-form__horizontal-group"><textarea class="pf-c-form-control" type="text" id="toImprove" name="field_eco_how_can_we_improve[und][0][value]" aria-label="textarea example"></textarea></div>
  </div>
  <div class="pf-c-form__group"><label class="pf-c-form__label" for="field_eco_email[und][0][value]"><span class="pf-c-form__label-text">Email address (optional)</span></label>
    <div class="pf-c-form__horizontal-group pf-c-form__horizontal-group--email"><input class="pf-c-form-control" type="email" id="email" name="field_eco_email[und][0][value]">
      <p>We may follow up with you if we need more information to act on your feedback.</p>
    </div>
  </div>
  <div class="pf-c-form__group">
    <div class="pf-c-form__actions">
      <div class="cover-spinner__container"><pfe-progress-indicator indeterminate="" size="md" pfelement="" class="PFElement" on="light"></pfe-progress-indicator></div><button class="pf-c-button pf-m-primary" id="ecoFeedbackFormSubmitBtn"
        disabled="true">Submit</button> <button class="pf-c-button pf-m-secondary" type="button" id="modalClose">Cancel</button>
    </div>
  </div>
</form>

Text Content

Skip to navigationSkip to contentYou need to enable JavaScript to run this app.
 * Hardware
   
   
   BY CATEGORY
   
    * Servers
    * Edge systems
    * Workstations
    * Components
   
   
   FEATURED LISTS
   
    * Red Hat Enterprise Linux 8 certified servers
    * Red Hat OpenStack 16 certified servers
    * Red Hat Virtualization 4 certified servers
   
   Explore certified hardware
 * Software
   
   
   BY CATEGORY
   
    * OpenShift operators
    * Helm charts
    * Containerized products
    * OpenStack infrastructure
    * Standalone applications
    * Container images
    * Vulnerability scanners
   
   
   FEATURED LISTS
   
    * OpenShift operators for Red Hat OpenShift 4
    * Standalone applications for Red Hat Enterprise Linux 8
    * CNF certified for Red Hat OpenShift
    * VNF certified for Red Hat OpenStack
   
   
   FEATURED BASE IMAGES
   
    * Red Hat Universal Base Image 8
    * Red Hat Universal Base Image 7
    * Red Hat Enterprise Linux 7
   
   Explore certified softwareManage container registry service accounts
 * Cloud & service providers
   
   
   BY CONSUMPTION TYPE
   
    * Upload an image
    * On demand
   
   
   FEATURED LISTS
   
    * Certified for Red Hat Enterprise Linux 8
    * Certified for Red Hat OpenShift 4
    * Certified for Red Hat OpenStack 15
   
   
   LEARN MORE
   
    * Red Hat Cloud Access
   
   Explore certified cloud

Help

Resources


RESOURCES

 * Blog
 * Partner podcast


MORE TO EXPLORE

 * All blogs
 * Events and webinars
 * Training and certification
 * Newsroom
 * Resource library
 * Customer success stories

All Red Hat
Back to menu

 * You are here
   
   
   
   
   RED HAT
   
   Learn about our open source products, services, and company.

 * You are here
   
   
   
   
   RED HAT CUSTOMER PORTAL
   
   Get product support and knowledge from the open source experts.

 * You are here
   
   
   
   
   RED HAT DEVELOPER
   
   Read developer tutorials and download Red Hat software for cloud application
   development.

 * You are here
   
   
   
   
   RED HAT PARTNER CONNECT
   
   Become a Red Hat partner and get support in building customer solutions.

--------------------------------------------------------------------------------


 * PRODUCTS
   
   
   * ANSIBLE.COM
     
     Learn about and try our IT automation product.


 * TRY, BUY, SELL
   
   
   * RED HAT HYBRID CLOUD
     
     Access technical how-tos, tutorials, and learning paths focused on Red
     Hat’s hybrid cloud managed services.
   
   
   * RED HAT STORE
     
     Buy select Red Hat products and services online.
   
   
   * RED HAT MARKETPLACE
     
     Try, buy, sell, and manage certified enterprise software for
     container-based environments.


 * COMMUNITY & OPEN SOURCE
   
   
   * THE ENTERPRISERS PROJECT
     
     Read analysis and advice articles written by CIOs, for CIOs.
   
   
   * OPENSOURCE.COM
     
     Read articles on a range of topics about open source.


 *  
   
   
   * RED HAT SUMMIT
     
     Register for and learn about our annual open source IT industry event.
   
   
   * RED HAT ECOSYSTEM CATALOG
     
     Find hardware, software, and cloud providers―and download container
     images―certified to perform with Red Hat technologies.


TESTED. CERTIFIED. SUPPORTED.

Build on Red Hat platforms and technologies with certified, enterprise-grade
products you need to achieve your business outcomes. We make it easy for you to
explore and find certified products from our large and robust ecosystem of
enterprise hardware, software, and cloud and service providers.


BROWSE BY PLATFORM

The leading enterprise Linux operating system, certified on hundreds of clouds
and with thousands of vendors.

Explore

Red Hat® OpenShift® is an enterprise-ready Kubernetes container platform with
full-stack automated operations to manage hybrid cloud, multicloud, and edge
deployments.

Explore

Red Hat® OpenStack® Platform virtualizes resources from industry-standard
hardware, organizes those resources into clouds, and manages them so users can
access what they need—when they need it.

Explore


BROWSE BY CATEGORY


CERTIFIED HARDWARE

Bare metal, appliances, and other hardware from Red Hat partners is certified
and supported for Red Hat technologies.

Explore


CERTIFIED SOFTWARE

OpenShift operators, containerized products, and traditional software certified
to run on Red Hat platforms.

Explore


CERTIFIED CLOUD AND SERVICE PROVIDERS

Run your applications on Red Hat platforms and technologies in supported clouds
and cloud service providers.

Explore


RED HAT PARTNER PODCAST

DITCHING THE COMMUTE - LIFE IN THE REMOTE WORLD

Episode 112|Published January 24, 2022



Listen to the episodeView more episodes



RED HAT BLOGS


BUILD A BOOTABLE JAR FOR CLOUD-READY MICROSERVICES

By Mauro Vocale|Published Wed, 26 Jan 2022 07:00:00 +0000



For microservices running in container environments, Java developers tend to
want a self-contained image that incorporates the complete runtime environment
needed to run an application. At the same time, developers want a minimally
sized image for both efficiency and security. A bootable JAR can meet these
requirements. This article describes how to create a bootable JAR using Red Hat
JBoss Enterprise Application Platform (JBoss EAP) and Jakarta EE and incorporate
useful extensions, particularly a PostgreSQL database and MicroProfile
capabilities.


ABOUT THE EXAMPLE APPLICATION

For this demonstration, I have updated the application used in my previous
series of articles. Like that series, this article runs the application on an
instance of Red Hat OpenShift Container Platform, an open source
Platform-as-a-Service (PaaS) based on Kubernetes. One of my priorities for all
of these demonstrations is to optimize the consumption of resources that are the
main factors in the costs charged by a PaaS vendor: image size, memory use, and
CPU use.

The bootable JAR is a feature of WildFly, a lightweight runtime for building
Java applications. We'll use JBoss EAP, a fully supported enterprise Java
platform based on WildFly. We'll provision custom layers that expand the
application's capabilities using Galleon feature-packs.

The source code for this application is available on my GitHub repository. To
track the application's evolution, I created a new tag named
Galleon_Runtime_EAP_XP_bootable_jar_version for the version used in this
article. You can use the tags assigned to repository branches to analyze the
configuration information through various iterations.


PREREQUISITES

You will need the following software to execute the example application:

 * A Red Hat OpenShift installation (I used OpenShift 4.8)
 * JBoss EAP 7.4
 * JBoss EAP XP 3.0
 * Apache Maven 3.8.2
 * OpenJDK 11
 * Git 2.31.1

Note: If you prefer, you could use Red Hat CodeReady Containers to run an
OpenShift instance on your local system.


GET THE SOURCE CODE

To install the source code from my GitHub repository, open a terminal, select a
folder, and clone the repository using the following command:

$ git clone https://github.com/mvocale/JBoss_EAP_cloud_ready.git

Now, change into the directory for the project. Check out the
Galleon_Runtime_EAP_XP_bootable_jar_version version, where I stored the code
used to implement the bootable JAR running mode, using the following command:

$ git checkout tags/Galleon_Runtime_EAP_XP_bootable_jar_version

The weather-app-eap-cloud-ready subdirectory contains the main application,
copied from an earlier version of the same application. The source code uses the
Jakarta EE 8 and MicroProfile 3 specifications on top of JBoss EAP XP 3 in
bootable JAR mode, employing Galleon to install only the required subsystems.
The final container image was improved using the runtime version of OpenJDK 11.

The application needs a database to store information, so I chose PostgreSQL.
The postgresql-database-layer subdirectory of the repository loads and
configures the database. I could have simply used a feature-pack from the
wildfly-datasources-galleon-pack project, which supports PostgreSQL as well as
Microsoft SQL Server and Oracle. But one goal of this article is to show how to
customize a JBoss EAP subsystem with features not supported by default, or how
to change the behavior of a feature through a custom layer.

A shell script named deploy-openshift.sh contains all the instructions needed to
install all the implemented components on top of OpenShift. If you don't want to
perform every single step described, you can establish a connection to CodeReady
Containers or an OpenShift remote cluster and run the script there.


SET UP YOUR ENVIRONMENT

Now it's time to connect to OpenShift to deploy all the components needed by our
application. If you are using CodeReady Containers, start it and log in as a
developer using the following commands:

$ crc start
$ oc login -u developer -p developer https://api.crc.testing:6443

Otherwise, log into your OpenShift environment as follows, substituting your own
appropriate values for $token and $server_url:

$ oc login --token=$token --server=$server_url

Create the project that will host the application:

$ oc new-project redhat-jboss-eap-cloud-ready-demo --display-name="Red Hat JBoss EAP Cloud Ready Demo"

Create and configure the PostgreSQL database:

# Import image related to Postgresql Database
$ oc import-image rhel8/postgresql-13:1-21 --from=registry.redhat.io/rhel8/postgresql-13:1-21 --confirm 
# Create the Postgresql Database Application
$ oc new-app -e POSTGRESQL_USER=mauro \
   -e POSTGRESQL_PASSWORD=secret \
   -e POSTGRESQL_DATABASE=weather postgresql-13:1-21 \
   --name=weather-postgresql


Add the PostgreSQL icon to the database:

$ oc patch dc weather-postgresql --patch '{"metadata": { "labels": { "app.openshift.io/runtime": "postgresql" } } }'

Now, deploy a set of actors that will help you get the benefits of MicroProfile
specifications:

 * Jaeger
 * Prometheus
 * Grafana

To install these projects, switch to the weather-app-eap-cloud-ready directory
that hosts the application source code and run the following:

# Import Jaeger image from catalog
$ oc import-image distributed-tracing/jaeger-all-in-one-rhel8:1.24.1-1 --from=registry.redhat.io/distributed-tracing/jaeger-all-in-one-rhel8:1.24.1-1 --confirm
# Create the Jaeger application
$ oc new-app -i jaeger-all-in-one-rhel8:1.24.1-1
# Expose the route in order to make the Jaeger application available outside of OpenShift
$ oc expose svc jaeger-all-in-one-rhel8 --port=16686

# Create the Prometheus environment used to collect the values provided by MicroProfile Metrics specifications. Import the Prometheus image from catalog
$ oc import-image openshift4/ose-prometheus:v4.8.0-202110011559.p0.git.f3beb88.assembly.stream --from=registry.redhat.io/openshift4/ose-prometheus:v4.8.0-202110011559.p0.git.f3beb88.assembly.stream --confirm
# Create the config map with the Prometheus configurations
$ oc create configmap prometheus --from-file=k8s/prometheus.yml
### Create the Prometheus application
$ oc create -f k8s/ose-prometheus.yaml

# Create the Grafana environment used to collect the values provided by MicroProfile Metrics specifications. Import Grafana image from catalog
$ oc import-image openshift4/ose-grafana:v4.8.0-202110011559.p0.git.b987e4b.assembly.stream --from=registry.redhat.io/openshift4/ose-grafana:v4.8.0-202110011559.p0.git.b987e4b.assembly.stream --confirm
# Create the config map with the Grafana configurations
$ oc create configmap grafana --from-file=k8s/datasource-prometheus.yaml --from-file=k8s/grafana-dashboard.yaml --from-file=k8s/jboss_eap_grafana_dashboard.json
# Create the Grafana application
$ oc create -f k8s/ose-grafana.yaml


BUILD A CUSTOM LAYER FOR JBOSS EAP XP

The version of the application created in my previous articles used
Source-to-Image (S2I) to define and configure the JDBC driver and data source
used by the application (see the installation shell script for details). I had a
folder named extensions where I defined:

 * The module.xml file and JAR file used by the JBoss EAP module
 * The drivers.env file, where I specified the driver properties
 * The install.sh file to instruct the S2I build where to find the resources
   needed to configure the JBoss EAP driver and data source

The postgresql-database-layer subproject builds all the resources needed to
provision and set up the JDBC driver and the data source subsystem. Let's change
into this subproject:

$ cd postgresql-database-layer

This project creates a layer to provision and configure the driver module and
the data source subsystem that manages the JDBC connection to the PostgreSQL
database. Under the src/main/resources directory are two subdirectories:

 * layers/standalone: Contains the files needed to configure the driver
   (postgresql-driver) and the data source (postgresql-datasource).
 * module/org/postgresql/main: Contains the file needed to manage the JBoss
   module used to interact with the PostgreSQL database.

In the postgresql-driver directory lies a layer-spec.xml file that contains the
parameters used by the Galleon framework to provision and configure the JDBC
driver:



	
    	    
             
        	  
        	  
        	  
    	     
	
	
    	    
	


Under the postgresql-datasource directory lies a layer-spec.xml file that
contains the parameters used by the Galleon framework to provision and configure
the data source:



	
    	
	
	
    	
    	
    	
    	
    	
    	
    	
    	
    	
    	
    	
    	
    	
    	
    	
    	
	



Finally, under the src/main/resources/modules/org/postgresql/main directory is a
module.xml file that configures the JBoss module:



    
   	 
    
    
   	 
   	 
    


The pom.xml file in the postgresql-database-layer directory builds the custom
feature-pack using the Maven Galleon plug-in:



   ...
   
      42.2.18.redhat-00001
      3.0.0.GA-redhat-00005
      5.2.4.Final
   

   
      
      
         org.postgresql
         postgresql
         ${version.org.postgresql}
      
      
         org.jboss.eap
         wildfly-galleon-pack
         ${version.wildfly.galleon.pack}
         zip
      
   

   
      
         
            org.wildfly.galleon-plugins
            wildfly-galleon-maven-plugin
            ${version.wildfly.galleon.maven.plugin}
            
               
                  wildfly-datasources-galleon-pack-build
                  
                     build-user-feature-pack
                  
                  compile
                  
                     true
                  
               
            
         
      
   


The build-user-feature-pack goal in the Galleon Maven plug-in builds the custom
layers.


BUILD A JBOSS EAP XP 3 BOOTABLE JAR

Unlike the example in my previous articles, this example does not put the
application into a JBoss EAP XP container image as a deployment artifact.
Instead, we create a bootable JAR containing a server, a packaged application,
and the runtime required to launch the application. The source code remains the
same.

Using a bootable JAR for deployment changes the following aspects of the
previous example:

 * How we provision and configure database connectivity: We use the feature-pack
   implemented through the postgresql-database-layer subproject.
 * How we build the application: We use the wildfly-jar-maven-plugin Maven
   plug-in to create a bootable JAR.
 * How we build the application image: Instead of a JBoss EAP XP image, we use
   an OpenJDK image at build time and runtime, since we created a bootable JAR.

The wildfly-jar-maven-plugin plug-in is invoked in the pom.xml file in the
weather-app-eap-cloud-ready subproject::



   ...
   
      
         
            org.wildfly.plugins
            wildfly-jar-maven-plugin
            ${bootable.jar.maven.plugin.version}
            
               
                  
                     org.jboss.eap:wildfly-galleon-pack:${version.wildfly.galleon.pack}
                  
                  
                     com.redhat.examples
                     postgresql-layer
                     1.0.0
                  
               
               
                  jaxrs-server
                  microprofile-platform
                  postgresql-datasource
               
               
            
            
               
                  
                     package
                  
               
            
         
      
   


Let's analyze the core elements of the Maven plug-in. The first important
element is the tag. The JBoss EAP JAR Maven plug-in uses Galleon's trimming
capability to reduce the size and memory footprint of the server. Thus, you can
configure the server according to your requirements, including only the Galleon
layers that provide the capabilities you need.

To specify the layers we want, I use two feature-packs:

 * wildfly-galleon-plugin specifies the layers provided by JBoss EAP XP.
 * postgresql-layer is the custom layer that builds the data source subsystem
   described in the previous section. To refer to this layer, I use the Maven
   GAV coordinates (group ID, artifact ID, and version) specified in the
   project's pom.xml file.

Those two feature-packs are used by the Galleon framework to build JBoss EAP XP
with only the requested subsystems. The tag specifies the required layers:

 * jaxrs-server: This layer contains the subsystem needed to implement the
   Servlet, JAX-RS, JPA, and CDI Jakarta EE specifications.
 * microprofile-platform: This decorator layer adds the MicroProfile
   capabilities to the provisioned server.
 * postgresql-datasource: This is my custom decorator layer that I created to
   manage the data source subsystem and the JDBC driver.

The tag appears in the element of the plug-in configuration in the pom.xml file
so that the JBoss EAP Maven JAR plug-in can recognize that you chose the
OpenShift platform.

Run Maven locally to create the weather-app-cloud-ready-1.0-bootable.jar JAR
file containing all you need to deploy the application into JBoss EAP XP inside
OpenShift:

$ mvn clean package


UPDATE THE BUILDCONFIG

In Part 4 of my previous series, I showed how to create a chained build to
produce a runtime image that contained only the resources needed to execute the
application. Using the bootable JAR mode with JBoss EAP XP, we can follow the
same approach. This time, we import the OpenJDK container images:

# Import image related to OpenJDK 11
$ oc import-image ubi8/openjdk-11:1.10-1 --from=registry.access.redhat.com/ubi8/openjdk-11:1.10-1 --confirm

# Import image related to OpenJDK 11 - Runtime
$ oc import-image ubi8/openjdk-11-runtime:1.10-1 --from=registry.access.redhat.com/ubi8/openjdk-11-runtime:1.10-1 --confirm

I have updated the buildConfig.yaml file under the k8s directory. That file now
defines a chained build with two buildConfig objects:
weather-app-eap-cloud-ready-build-artifacts and weather-app-eap-cloud-ready. The
first object is a base platform image for building and running plain Java 11
applications, such as a fat JAR and a flat classpath. The container image
contains S2I integration scripts for deployment on OpenShift.

The second object is a lean, runtime-only container designed to be a base for
deploying prebuilt applications. The container does not contain the Java
compiler, the JDK tools, or Maven. Here, I put my fat JAR containing the JBoss
EAP XP server and the application:

kind: ImageStream
apiVersion: image.openshift.io/v1
metadata:
  name: weather-app-eap-cloud-ready-build-artifacts
  labels:
    application: weather-app-eap-cloud-ready-build-artifacts
---
kind: ImageStream
apiVersion: image.openshift.io/v1
metadata:
  name: weather-app-eap-cloud-ready
  labels:
    application: weather-app-eap-cloud-ready
---
kind: BuildConfig
apiVersion: build.openshift.io/v1
metadata:
  name: weather-app-eap-cloud-ready-build-artifacts
  namespace: redhat-jboss-eap-cloud-ready-demo
  labels:
    build: weather-app-eap-cloud-ready-build-artifacts
spec:
  output:
    to:
      kind: ImageStreamTag
      name: 'weather-app-eap-cloud-ready-build-artifacts:latest'
  resources: {}
  strategy:
    type: Source
    sourceStrategy:
      env:
        - name: ARTIFACT_DIR
          value: weather-app-eap-cloud-ready/target
      from:
        kind: ImageStreamTag
        namespace: redhat-jboss-eap-cloud-ready-demo
        name: 'openjdk-11:1.10-1'
  source:
    type: Binary
    binary: {}
---
kind: BuildConfig
apiVersion: build.openshift.io/v1
metadata:
  labels:
    application: weather-app-eap-cloud-ready
  name: weather-app-eap-cloud-ready
spec:
  output:
    to:
      kind: ImageStreamTag
      name: weather-app-eap-cloud-ready:latest
  source:
    images:
    - from:
        kind: ImageStreamTag
        name: weather-app-eap-cloud-ready-build-artifacts:latest
      paths:
      - sourcePath: /deployments
        destinationDir: ./deployments
    dockerfile: |-
      FROM openjdk-11:1.10-1
      COPY deployments /
      CMD  java -jar /deployments/weather-app-cloud-ready-1.0-bootable.jar
  strategy:
    dockerStrategy:
      imageOptimizationPolicy: SkipLayers
      from:
        kind: ImageStreamTag
        name: openjdk-11-runtime:1.10-1
        namespace: redhat-jboss-eap-cloud-ready-demo
    type: Docker
  triggers:
  - imageChange: {}
    type: ImageChange


DEPLOY THE APPLICATION

Now it's time to create the ImageStream instances and the chained buildConfig to
build and deploy the application:

# Move to the project directory
$ cd weather-app-eap-cloud-ready

# Create the ImageStreams and the chained builds config to make the runtime image with JBoss EAP XP 3 and the application
$ oc create -f k8s/buildConfig.yaml

# Move to the project root
$ cd ..

# Start the build of the application on OpenShift
$ oc start-build weather-app-eap-cloud-ready-build-artifacts --from-dir=. --wait

I suggest checking when the second build is finished by using this command:

$ oc get build weather-app-eap-cloud-ready-1 --watch

After the status moves from Pending to Complete, you can create the weather
application for JBoss EAP XP 3 and configure all the needed resources:

$ oc create -f k8s/weather-app-eap-cloud-ready.yaml

You can then test the application, using the steps described in the previous
articles, to verify that it works. Although I revisited the way to build and
deploy my application, the source code and the features remain the same. I can
continue to use all the specifications provided by Jakarta EE and MicroProfile
using the fat JAR mode, like the majority of Java cloud-friendly frameworks.


RESOURCE OPTIMIZATION

Using the Galleon framework for a container runtime image reduces the use of
expensive resources. In Part 4 of my previous series, I showed how you can save
about 35% of the space in the memory image and about 28% of its memory footprint
using this approach instead of the traditional container image with the full
JBoss EAP XP framework and all the developer tools. I obtained the same result
using the bootable JAR approach.

Figure 1 shows the size of the container image with OpenJDK and the bootable JAR
(JBoss EAP XP plus the application).

Figure 1. The size of the complete image is only 248.1 MiB.

Figure 2 shows the memory footprint.

Figure 2. The memory footprint of running image is only 403.1 MiB.

As these figures show, I obtained results similar to the previous series without
changing my code.


CONCLUSION

This article shows how to modernize your application to run in the cloud while
implementing the features provided by Jakarta EE and MicroProfile. I
demonstrated an approach using a bootable JAR, like the majority of the Java
frameworks aimed at cloud deployment, without needing to change any application
code. You can start using this approach now or adopt it later.

The impact on your code is very minimal with this approach, so you can keep
evolving your applications as you need to. Continuous improvement is key to the
success of your architecture.

The post Build a bootable JAR for cloud-ready microservices appeared first on
Red Hat Developer.







Read the articleView more blog posts



RED HAT MARKETPLACE

Red Hat® Marketplace is a single source to try, buy, and manage certified
operators for Red Hat OpenShift®. It offers responsive support, streamlined
billing and contracting, simplified governance, and a single dashboard across
clouds.

Explore Red Hat Marketplace


WHY CHOOSE RED HAT CERTIFIED SOLUTIONS?

Built and tested to exacting standards. Ready to deploy in your environment with
confidence.

Detailed interoperability, compatibility, and security details to choose the
right solutions for your business needs.

Fully supported by the provider while maintaining your relationship with Red
Hat’s global support services.


PARTNER WITH RED HAT

We provide a variety of partner resources to assist you through the
certification process to deliver the best possible experience to our mutual
customers. Join the Red Hat Certified Ecosystem and showcase your product to
millions of potential clients, customers, sellers, and developers.

Learn more about how Red Hat Partner Connect can help you succeed
Timestamp: Tue Jan 25 13:47:17 UTC 2022SHA: headVersion: 1.92


PRODUCTS & SERVICES

 * Certified hardware
 * Certified software
 * Certified cloud & service providers


TRY, BUY, SELL

 * Red Hat Marketplace
 * Red Hat Store
 * Buy online (Japan)
 * Contact sales
 * Try OpenShift 4
 * Partner with us


HELP

 * Trust Red Hat
 * Catalog documentation
 * Customer resources
 * Developer resources
 * Training and certifications
 * Security contacts


ABOUT

The Red Hat Ecosystem Catalog is the official source for discovering and
learning more about the Red Hat Ecosystem of both Red Hat and certified
third-party products and services.

Partner with us
LinkedIn Twitter Twitter
Red Hat
 * © 2022 Red Hat, Inc.
 * Privacy statement
 * Terms of use
 * Cookie-Präferenzen
 * All policies and guidelines

Logo-Red_Hat-Summit-A-Standard-RGB


SUCCESS ALERT: THANK YOU FOR YOUR FEEDBACK!

Have feedback?


YOUR FEEDBACK IS IMPORTANT TO US

Your company/organization

Your role
Select your roleArchitectDeveloperDevOps EngineerProduct ManagerSystems
AdministratorOther
What is working well?

How can we continue to improve?

Email address (optional)

We may follow up with you if we need more information to act on your feedback.


Submit Cancel