VOOZH about

URL: https://www.javacodegeeks.com/2018/03/payara-micro-on-oracle-application-container-cloud.html

โ‡ฑ Payara Micro on Oracle Application Container Cloud - Java Code Geeks


In this blog post, I will describe how to deploy the CloudEE Duke application packaged in a Payara Micro รผber-jar to Oracle Application Container Cloud.

The deployment artifact required for deployment in Oracle Application Container Cloud is a ZIP archive containing the application รผber-jar and a manifest file (manifest.json). The Payara Micro version of the manifest.json for CloudEE Duke is listed below.

manifest.json

{
 "runtime": {
 "majorVersion": "8"
 },
 "command": "java -jar cloudee-duke-microbundle.jar --port $PORT",
 "release": {
 "version": "1.0",
 "build": "1",
 "commit": "123"
 },
 "notes": "Dukes says hello from Payara"
}

You need to specify the port for Payara Micro in the startup command. This is done by using the $PORT environment variable.

The รผber-jar is produced by using the Payara Micro Maven Plugin:

<plugin>
 <groupId>fish.payara.maven.plugins</groupId>
 <artifactId>payara-micro-maven-plugin</artifactId>
 <version>1.0.1-SNAPSHOT</version>
 <executions>
 <execution>
 <goals>
 <goal>bundle</goal>
 </goals>
 </execution>
 </executions>
 <configuration>
 <payaraVersion>${version.payara.micro}</payaraVersion>
 <autoDeployEmptyContextRoot>true</autoDeployEmptyContextRoot>
 </configuration>
</plugin>

See the complete pom.xml for an example on how to produce the deployable ZIP archive with the maven command:

mvn clean package payara-micro:bundle assembly:single -Ppayara

This will produce a file called cloudee-duke-oracle-payara.zip  in the target folder. This is the ZIP archive you will deploy to Oracle Application Container Cloud as shown in the screenshot below.

๐Ÿ‘ Image

When your application is deployed, you should be able to access the hello endpoint

https://<dependsonyouraccount>.oraclecloud.com/hello

Duke says Hello!

You will also have the health and metrics endpoints provided by the MicroProfile implementation

https://<dependsonyouraccount>.oraclecloud.com/health

{
outcome: โ€œUPโ€,
checks: [ ]
}

https://<dependsonyouraccount>.oraclecloud.com/metrics

# TYPE vendor:system_cpu_load gauge
# HELP vendor:system_cpu_load Display the โ€œrecent cpu usageโ€ for the whole system. This value is a double in the [0.0,1.0] interval. A value of 0.0 means that all CPUs were idle during the recent period of time observed, while a value of 1.0 means that all CPUs were actively running 100% of the time during the recent period being observed. All values betweens 0.0 and 1.0 are possible depending of the activities going on in the system. If the system recent cpu usage is not available, the method returns a negative value.
vendor:system_cpu_load 0.005405405405405406
โ€ฆ

Published on Java Code Geeks with permission by Ivar Grimstad, partner at our JCG program. See the original article here: Payara Micro on Oracle Application Container Cloud

Opinions expressed by Java Code Geeks contributors are their own.

Do you want to know how to develop your skillset to become a Java Rockstar?
Subscribe to our newsletter to start Rocking right now!
To get you started we give you our best selling eBooks for FREE!
1. JPA Mini Book
2. JVM Troubleshooting Guide
3. JUnit Tutorial for Unit Testing
4. Java Annotations Tutorial
5. Java Interview Questions
6. Spring Interview Questions
7. Android UI Design
and many more ....
I agree to the Terms and Privacy Policy

Thank you!

We will contact you soon.

๐Ÿ‘ Photo of Ivar Grimstad
Ivar Grimstad
March 27th, 2018Last Updated: March 26th, 2018
0 74 1 minute read

Ivar Grimstad

Ivar Grimstad is an experienced software architect focusing on Enterprise Java. He is participating in the Java Community Process as a member of the Expert Groups for JSR 368 (JMS 2.1), JSR 371 (MVC 1.0), JSR 375 (Java EE Security API). He is also a member of the NetBeans Dream Team.
Subscribe

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Back to top button
Close
wpDiscuz