Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

Putting the “Micro” in Microservices with WildFly Swarm

September 6, 2016
Chris Tozzi
Related topics:
JavaMicroservices
Related products:
Red Hat Data Grid

    Do you like JavaEE apps, but wonder how to fit them into a microservices-centric workflow? WildFly Swarm is the answer.

    I know—“Java” and “microservices” are not words that seem to go together. Java is an old, relatively unsexy programming language. It’s a pretty useful one, but it was created long before the era of Continuous Delivery, containers and microservices.

    But that doesn’t mean you have to give up on Java if you want to take advantage of microservices. WildFly Swarm makes it easy to split the difference between Java development and microservices deployment by sizing down your JavaEE apps.

    Keep reading for an overview of how WildFly Swarm optimizes JavaEE deployment, and a quick guide to getting started with WildFly Swarm.

    How WildFly Swarm Works

    In September 2016, the most recent version of WildFly Swarm (2016.9), was released. WildFly Swarm builds on the foundation of WildFly, the JavaEE application server formerly known as JBoss, to better facilitate Java EE microservice development.

    Simply put, WildFly Swarm lets you take a JavaEE app and boil it down to only the essential parts necessary to run it as an uber-JAR file. The result is a leaner, meaner way to deploy Java apps.

    If this sounds a bit like unikernels, that’s because it is. But while unikernels in general are a cool idea that has yet to be widely implemented in practice, WildFly Swarm is here and ready for production now.

    Why WildFly Swarm?

    At this point, you may be wondering why you’d want to include a customized application service inside an uber-JAR with your application. After all, it’s not as if traditional Java application servers are the biggest thing taking up space on your infrastructure. And Java deployments via WildFly are already pretty fast.

    That said, why run your Java apps in an application server that has many pieces that aren't used? By cutting out the fat via WildFly Swarm, you get an app and application server combined uber-JAR that sucks up less memory, and is more responsive. Plus, by eliminating unnecessary overhead, they improve security because they reduce your apps’ exposure.

    Packaging as an uber-JAR is a perfect fit for providing a single artifact to be passed through the entire CI/CD pipeline. While also ensuring that what was tested is exactly what's in production, as there are no longer any concerns with differing application server configurations between environments.

    In short, WildFly Swarm lets you fully embrace all the benefits of a microservices-oriented development and deployment workflow. You no longer have to take a monolithic approach to building and running JavaEE apps. Instead, you can compile and deploy just the parts you need, and leave out everything you don’t.

    Setting Up WildFly Swarm

    Excited yet? If not, consider also that deploying WildFly Swarm is pretty trivial if you already have a Java EE project. You just add the wildfly-swarm-plugin to your pom.xml file between plugin tags, like so:

    <plugin>
      <groupId>org.wildfly.swarm</groupId>
      <artifactId>wildfly-swarm-plugin</artifactId>
      <version>${version.wildfly-swarm}</version>
      <executions>
        <execution>
          <phase>package</phase>
          <goals>
            <goal>package</goal>
          </goals>
        </execution>
      </executions>
    </plugin>

    You also need a dependency block like:

    <dependency>
        <groupId>org.wildfly.swarm</groupId>
        <artifactId>jaxrs</artifactId>
        <version>${version.wildfly-swarm}</version>
        <scope>provided</scope>
    </dependency>

    From there, you just build your project. You’ll get a WildFly Swarm-enabled JAR, which will put a traditional application server to shame in terms of leanness and resource optimization.

    For a deeper dive into what WildFly Swarm can do, you can check out examples on GitHub. And complete documentation is available from the WildFly Swarm website.

     

    About Chris

    Screen Shot 2016-08-16 at 1.29.59 PMChris Tozzi has worked as a journalist and Linux systems administrator. He has particular interests in open source, Agile infrastructure and networking. He is Senior Editor of content, and a DevOps Analyst at Fixate IO.

    Last updated: September 25, 2024

    Recent Posts

    • Federated identity across the hybrid cloud using zero trust workload identity manager

    • Confidential virtual machine storage attack scenarios

    • Introducing virtualization platform autopilot

    • Integrate zero trust workload identity manager with Red Hat OpenShift GitOps

    • Best Practice Configuration and Tuning for Linux and Windows VMs

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.