Running the Microservice

Java EE enables the developer to choose from many ways of running the Microservice. As the architecture of Java EE uses layers, where standards and their implementations act as one layer and the Microservice itself is built on top of the standards, the developer has many options. Among other things, it is now possible to do the following:

  • Deploy to a classical application server.
  • Create an UberJar that contains all the necessary functionality within one easily-runnable Java Archive.
  • Create a hollow jar (which is the same as UberJar but does not contain the application code), which provides all the dependencies for the Microservice to be deployed on top of it.
  • Run Microservices directly from the command line with Payara Micro.

An easy way of running Java EE Microservices or just about any Java EE applications is using Payara Micro and the command line. To download Payara Micro, visit payara.fish/downloads. Backward compatibility is part of the Java EE contract, thus downloading the latest version is an obvious step.

Payara Micro is a Java application that is able to run other Java EE applications. It provides a Command-Line Interface (CLI). Interacting with Payara Micro means running it as an ordinary Java program; nothing more is required. The readiness of the environment can be tested by asking for a Payara version:

> java -jar /path/to/payara-micro-{version}.jar --version
Payara Micro 4.1.2.173 Build Number 235

A list of Payara Micro's services can be displayed by means of the --help flag:

> java -jar /path/to/payara-micro-4.1.2.173.jar --help

Among the many options, the --deploy option followed by a path to the Java EE Microservice is designed to simply run any Java EE Microservices. Payara Micro invoked with the --deploy option is used to deploy the Weather Microservice. It even has the ability to deploy multiple Microservices at once, if required.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.172.115