Skip to content

An example Spring Boot project that's prepped to be deployed as a microservice (Dockerized and deployable via Architect.io)

License

Notifications You must be signed in to change notification settings

davidthor/spring-boot-microservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Architect Logo

Java Spring Boot Microservices Example

This repository contains an example microservice project built in Java and using the Spring framework. The project itself serves a simple web application that acts as a log book for guest visitors – allowing visitors to log their name into the application to show up on the list of previous visitors.

Running the application

This application depends on a MySQL database to keep track of visitors. In order to streamline the spin up of the database alongside our microservice, we've created an Architect Component that encapsulates both the database and our project.

Prerequisites

Run locally

# Link the component to our local registry
$ architect link .

# Deploy the component
$ architect deploy --local davidthor/java-spring-example:latest -i app:app

Hot reloading

The project is automatically configured to hot reload when it detects changes to the compiled code, but Spring requires a separate process to watch raw source code and re-compile. Run the following in another session to enable hot-reloading:

$ cd ./src/
$ ./gradlew build --continuous

Any time you make changes to the source code, you'll first see this window pickup the changes and re-compile before quickly seeing the original architect deploy process respond to the newly compiled code and restart the server.

Cloud deployment

Architect Component's can be easily deployed to remote cloud environments with their continuous delivery platform. Simply register the component, register a target environment, and deploy the former to the latter:

# Login to your account
$ architect login

# Register the component
$ architect register . --tag latest

# Register an environment
$ architect platforms:create my-platform

# Register an environment
$ architect environments:create my-environment --platform my-platform

# Deploy to the environment
$ architect deploy davidthor/java-spring-example:latest -e my-environment -i app:app

About

An example Spring Boot project that's prepped to be deployed as a microservice (Dockerized and deployable via Architect.io)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published