Do you want your ad here?

Contact us to get your ad seen by thousands of users every day!

[email protected]

Building Microservices with Spring Boot Fat (Uber) Jar

  • April 21, 2021
  • 4450 Unique Views
  • 3 min read
Table of Contents
Installation of Spring Boot Fat (Uber) Jar BuilderRunning Multiple Microservices with Spring Boot Projects

In most minds, microservices is an approach to make a traditional monolithic system more structured, dividing it into logical components that correspond to different functional areas of application. Thus, acting as a microservice, each component becomes self-contained, easily scaled, maintained and even upgraded without affecting the overall system. Also, with microservice architecture, you can use a software written in different programming languages, including Java. Such freedom attracts but may frighten at the same time.

You can spend hours reading numerous articles in the net, regarding how to build microservices along with some boring examples. However theory without practice gets nowhere.

For a quick start, we have prepared a package with Maven and popular framework Spring Boot inside Java Engine node. It automates building a sample Java project as Fat (or so-called Uber) Jar to run it as a microservice.

jelastic spring boot microservices tutorial

Installation of Spring Boot Fat (Uber) Jar Builder

To get started, log in to Jelastic dashboard, find the Spring Boot Fat Jar Builder in the Marketplace and click Install.

building microservices

Or you can Import the required manifest using the link from GitHub:

https://github.com/jelastic-jps/spring-boot/blob/master/microservice-fat-jar/manifest.jps

maven archetype spring boot

If required, change installation settings such as environment name or Git repository link to a custom Spring Boot project. Then press Install.

java spring boot

When the installation and building of the project are completed, a corresponding message appears. You still need to wait a few minutes for deploy to be finished (feel free to track the process in Tasks panel). In the default implementation, it is done under api/greeting context.

how to build microservices

Afterwards, you can make sure, that application is up and running by pressing Open in browser button.

spring boot uber jar

Running Multiple Microservices with Spring Boot Projects

You can use just created Maven node for building extra projects and deploying them to different environments to get a set of distributed microservices.

spring boot microservices example

First of all, create a separate environment with Java Engine.

spring boot maven tutorial

Then click Add Project next to the Maven node in the initial environment.

spring boot maven

Specify the name and link to the project, as well as choose the environment where it should be deployed. Additionally, you can activate automatic updates. Then confirm pressing Add + Deploy.

spring boot maven plugin

More details on how to build and deploy Java applications can be found at the Maven node documentation.

In this way, you can easily build and deploy your Spring Boot based applications packaged in JAR files using Fat/Uber approach. Register and try out this implementation for your custom project to feel the benefits of microservices running in the cloud.

Clean Shutdown of Spring Boot Applications

Article discusses and presents five ways to shutdown Spring Boot apps cleanly. It provides inline code samples and link to GitHub.

IntelliJ IDEA Icon
Creating a Simple Spring Boot Application in IntelliJ IDEA

In this tutorial, we’ll use the New Project Wizard in IntelliJ IDEA to create a Spring Boot project with the Spring Web dependency.

We’ll also create a Spring Controller and served some text to the local Tomcat webserver.

Finally, we’ll add a test for our HTTP call.

Deploying Spring Boot Applications on Kubernetes

In this article, I will explain how you can create a pod, deploy a Spring Boot application, and manage the single node cluster with Lens IDE on Docker Desktop.

By the end, you will have learned how to enable Kubernetes on Docker Desktop for Mac, created a basic pod, deployed a Spring Boot application, and managed our single-node Kubernetes cluster with the help of Lens IDE.

What are you waiting for? Go containerize and share your applications!

Containerizing Spring Boot Applications with Jib

In this post, we will learn about how to create Docker or OCI compliant images, without installing any Docker client and without using a Dockerfile, for a Spring Boot application.

Other benefits of using Jib for your Java applications include that it’s super easy to integrate with Java applications, producing faster builds, reproducible builds, community support, etc.

Book Review: “Effortless Cloud-Native App Development Using Skaffold”

There is no better time than the present for a book such as this, which can surely be seen to be some kind of Skaffold Bible.

The author provides a complete and thorough overview of the central issues faced by users of Kubernetes, presents Skaffold as a solution, highlights its features and pitfalls, while placing it within the context of the broader ecosystem of comparable solutions.

Do you want your ad here?

Contact us to get your ad seen by thousands of users every day!

[email protected]

Comments (0)

Highlight your code snippets using [code lang="language name"] shortcode. Just insert your code between opening and closing tag: [code lang="java"] code [/code]. Or specify another language.

No comments yet. Be the first.

Subscribe to foojay updates:

https://foojay.io/feed/
Copied to the clipboard