Facilitating the spread of knowledge and innovation in professional software development



Choose your language

InfoQ Homepage News Apache OpenWebBeans Releases Meecrowave Server Version 1.0 for Java EE-Based Microservices

Apache OpenWebBeans Releases Meecrowave Server Version 1.0 for Java EE-Based Microservices


Apache OpenWebBeans, an implementation of JSR 365 dependency injection (CDI 2.0), recently released version 1.0 of their Meecrowave microservices server that provides built-in support for the Java Persistence API (JPA), the Java Transaction API (JTA), and OAuth2 without requiring a full container such as Java EE.

Meecrowave is built on top of some existing Apache projects, including Tomcat (servlets), OpenWebBeans (CDI), Johnzon (JSON-P and JSON-B), and CFX (JAX-RS).

Meecrowave, initially released in January 2017, may be used for microservices and standalone applications. As defined in their blog:

Meecrowave can be either started via a maven plugin (for ease of development), or programmatically as an embedded server, bundled as an application with your business code or as a runner to start up a portable WAR or JAR applications.

Meecrowave is comprised of the following components:

The core component defines a range of configuration and command line interface (CLI) options. Custom CLI options may also be defined by implementing the Cli.Options interface and using the @CliOption annotation as shown below.

The Maven and Gradle components provide the properties that correspond with the core configuration and CLI options, and allow for changes to the default values.

Getting Started

The following JAX-RS example demonstrates how to get started with Meecrowave.

The Defaults class defines a default first and last name for the example application. Note the use of extending the CLI with an option named app-default-name along with its corresponding description.

public class Defaults implements Cli.Options {
   @CliOption(name="app-default-name", description="The default first and last names for the app.")
   private String firstName="Michael";
   private String lastName="Redlich";

   public String getFirstName() {
       return firstName;

   public String getLastName() {
       return lastName;

The DefaultsProducer class injects an instance of Meecrowave’s Builder class for initiating Meecrowave. The getExtension() method captures the name and description defined in the @CliOption annotation from the Defaults class.

public class DefaultsProducer {
   private Meecrowave.Builder builder;

   public Defaults defaults() {
       return builder.getExtension(Defaults.class);

The SimpleApplication class defines the main application path, redlich:

public class SimpleApplication extends Application {

The SimpleEndpoint class defines the endpoint, meecrowave, URL query parameters, firstName and lastName, and an inner class, Hello, a Java bean used to model a first and last name.

public class SimpleEndpoint {
   private Defaults defaults;

   public Hello sayFullName(@QueryParam("firstName") final String firstName,@QueryParam("lastName") final String lastName) {
       return new Hello(ofNullable(firstName).orElse(defaults.getFirstName()),ofNullable(lastName).orElse(defaults.getLastName()));

   public static class Hello {
       private String firstName;
       private String lastName;

       public Hello() {

       private Hello(final String firstName,final String lastName) {

       public String getFirstName() {
           return firstName;

       public void setFirstName(final String firstName) {
           this.firstName = firstName;

       public String getLastName() {
           return lastName;

       public void setLastName(final String lastName) {
           this.lastName = lastName;

Compile and run with Maven:

mvn clean package meecrowave:run

Once the server is running, the complete URL is comprised of the main application path and endpoint that may be entered in the browser:


Note the default values of “Michael” and “Redlich” are displayed. URL query parameters may be used to change the default values defined in firstName and lastName. The following example changes only the first name via the URL:


This next example demonstrates how to change both first and last names via the URL:


The entire sample application can be found on GitHub.

Meecrowave also has companion projects:

  • Apache DeltaSpike (configuration, exception handling, advanced CDI)
  • Apache Sirona (monitoring)

Support for the new CDI 2.0 specification is gaining traction, and Apache recently released OpenWebBeans 2.0.0 that was designed to work with the new CDI 2.0 specification.

We need your feedback

How might we improve InfoQ for you

Thank you for being an InfoQ reader.

Each year, we seek feedback from our readers to help us improve InfoQ. Would you mind spending 2 minutes to share your feedback in our short survey? Your feedback will directly help us continually evolve how we support you.

Take the Survey

Rate this Article


Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p


Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.