Introducing Payara Micro

Uncategorized

4_fish_1_resized.jpgWe are about to release the latest version of Payara (4.1.152) and one of the cool new features that is experimental in this release is Payara Micro. 

What is Payara Micro?

Payara Micro is our first release of a new way of running Java EE applications. Building on the Java EE 7 support of its GlassFish 4.1 core Payara Micro enables you to run war files from the command line without any application server installation.

java -jar payara-micro.jar --deploy test.war

That’s not all! Using the Hazelcast integration each Payara Micro process will automagically cluster with other Payara Micro processes on the network, giving web session resilience and a fully distributed data cache using Payara’s JCache support.

Why Payara Micro?

Payara Micro is small, only 57MB in size and incredibly simple to use. With its automatic and elastic clustering it is designed for running Java EE applications in a modern containerized/virtualized infrastructure using automated provisioning tools like Chef, Ansible or Puppet. As each Payara Micro server will automatically cluster with other servers on the network your Java EE application can be elastically scaled horizontally by adding and removing containers based on demand.

Embedding Payara Micro

 Payara Micro also comes with a Java api so it can be embedded and launched from your own Java applications. Embedding Payara Micro in your own code is as simple as;

 

import fish.payara.micro.BootstrapException;
import fish.payara.micro.PayaraMicro;

public class EmbeddedPayara {

    public static void main(String[] args) throws     
    BootstrapException  {

        PayaraMicro.getInstance()                           
            .addDeployment("test.war")                            
        	.bootStrap();    }    
    }

}


What apis does Payara Micro Support?

Payara Micro is based on the Java EE 7 web profile version of GlassFish embedded. We’ve built on that and added a number of useful additional apis.

Key apis Payara Micro supports are;

•    Servlets, JSTL, EL and JSPs
•    WebSockets
•    JSF
•    JAX-RS
•    EJB lite
•    JTA
•    JPA
•    Bean Validation
•    CDI
•    Interceptors
•    JBatch
•    Concurrency
•    JCache


How do I get Payara Micro?

Payara Micro will be released with the next version of Payara and will be available from the downloads page. Prior to that you can get it from our pre-releases page.


Give us feedback!

We’d love you to try your Java EE 7 applications on Payara Micro. Let us know what you like or even what you hate. What features would you like to see? As always we are here to help!

 

{{cta(‘4c7626f5-1e53-418e-90c8-add6e4af19c9′,’justifycenter’)}}

 

 

Comments (7)

Post a comment

Your email address will not be published. Required fields are marked *

Payara needs the contact information you provide to us to contact you about our products and services. You may unsubscribe from these communications at any time. For information on how to unsubscribe, as well as our privacy practices and commitment to protecting your privacy, please review our Legal & Privacy Policy.

  1. John Hogan

    Keep up the great work Payara!

  2. Italivio CORREA

    How to add certificate chains in micro payara?
    How to replace the domain-passwords file?

    1. Ondrej Mihályi

      Dear Italivio,

      Although it is not obvious, you can modify Payara Micro JAR with –outpuUberJar option, which will conserve all arguments passed on command line and create a new executable Payara Micro JAR with those options as defaults. The version 171 now also correctly packages the whole directory referenced by –rootDir argument, and adds support for passing a file that contains asadmin commands that will be executed from within Payara Micro to configure itself (–postbootcommandfile).

      Therefore, you should be able to configure Payara Micro in the same way as Payara server, using the following technique:

      1. execute: `java -jar payara-micro,jar –rootDir domain`, wait until Payara Micro boots and stop it. You will see a new folder `domain`, which contains all the files you would normally find in Payara Server domain
      2. You can configure, add/remove any file in the `domain` directory to adjust the configuration
      3. If you want to execute some asadmin commands rather than modyfing the files by hand, you can create a new file next to payara-micro.jar, called e.g. post-boot-commands.asadmin, and write commands into the file, one command per line.
      4. Build a new Payara Micro JAR with your custom configuration, using the –outputUberJar argument, like this: `java -jar payara-micro.jar –rootDir domain –postbootcommandfile post-boot-commands.asadmin –outputUberJar my-payara-micro.jar`
      5. You can use the generated my-payara-micro.jar file in the same way as the stock payara-micro.jar, but it will contain updated configuration from the domain directory and will run asadmin commands after boot if you provide the boot command file. Like this: `java -jar my-payara-micro.jar –deploy myapplication.war`

  3. Italivio CORREA

    Tip: Allow the –deployFromGAV option to tell you the type of the artifact. For example: fish.payara.examples, test, 1.0-SNAPSHOT, war

  4. Karan Thanvi

    How can I restart the application deployed on payara-micro, or the micro instance itself ? (similar to asadmin restart-instance or something) ?

    1. Mike Croft

      Hi Karan,

      Since Payara Micro is simply a Java process, the best way is to simply stop it and start it again. If you are running Payara Micro in the foreground, you can do this with CTRL+C.

      Recent versions of Payara Micro can cluster with a DAS and the DAS can send asadmin commands to the Payara Micro. Unfortunately, the only lifecycle commands which exist in Payara Micro are start/stop/restart-domain. The commands get sent successfully and received by the Payara Micro instance, but the code to action the command does not appear to be there.

      I created an enhancement request for this on your behalf because I think it would be a useful feature:
      https://github.com/payara/Payara/issues/2300

  5. Julien Sié

    Excellent. Very nice 🙂 Would be smarter with an example using a Docker – MySQL but anyway thanks for the tips.

Related Posts

Community_Announcement 4 minutes
Uncategorized

Leading the Way: Payara Platform Community 7 Beta Now Fully Jakarta EE 11 Certified

We’re excited to announce that Payara Platform Community 7 Beta application server is now fully certified as Jakarta EE 11 […]

Blue background with coral and fish. Left text: 'MONTHLY CATCH'. Right: laptop screen with tech tabs and Payara Community logo. 4 minutes
Community

The Payara Monthly Catch – August 2025

Welcome aboard the August 2025 issue of The Payara Monthly Catch! With summer in full swing, things may have felt […]

What Is a Java Application Server? A Short Guide 6 minutes
Jakarta EE

What Is a Java Application Server? A Short Guide

Enterprise Java applications power global commerce, healthcare, government and countless other industries. These systems must be scalable, secure and […]