Spring Boot
Hosting Spring Boot Standalone and Clustered Java Applications
Spring Boot applications can be deployed as standalone Java services or scaled into clustered environments. The platform supports executable JAR, WAR and ZIP-based deployments, multiple build and CI/CD workflows, container-level configuration, automatic scaling, SSL and custom-port exposure.
Create a Spring Boot Environment
Open the environment topology wizard, switch to the Java language tab and select the Spring Boot application-server template. Set the required resource limits, enter the environment name and create the environment.
After the environment appears in the dashboard, use Open in Browser to launch the pre-installed sample and verify that the Spring Boot server is running.
Deploy Java Applications to Spring Boot
Applications should be packaged as executable archives containing the compiled classes, dependencies and resources required to run the project.
JAR
Suitable for standalone Java applications and stateless microservices. The JAR should define its entry point in the manifest or be packaged as a fat or nested executable JAR.
WAR
Suitable for web applications with an embedded servlet container and can be useful for JSP-based Spring Boot projects.
For manual deployment, upload the application archive through Deployment Manager, click Deploy to, select the Spring Boot environment and confirm the deployment.
ZIP Bundle Deployment
A ZIP bundle can contain an executable JAR together with external configuration files, logging configuration, libraries and other directories. This is useful when production settings should remain outside the packaged JAR.
application.zip | +-config | +-application.properties | +-log4j.properties +-lib | +-my-springboot-app.jar +-some_directory | +-additional_file1 | +-additional_file2 +-additional_configuration.yml
When the ZIP archive is unpacked, the platform searches its directories for a runnable JAR. A JAR containing a Main-Class entry in META-INF/MANIFEST.MF can be used as the execution point.
Remote Deployment through CLI
Applications can also be deployed remotely using the platform CLI.
~/jelastic/environment/control/deployapp \ --envName spring-boot-app \ --fileUrl http://link/to/archive \ --fileName my_springboot.jar \ --context ROOT
Check Application Logs
After deployment, allow the application enough time to initialize. The startup process can be monitored through the Spring Boot server run.log.
If the application listens on the standard port 8080, it can be opened through the environment URL after startup completes.
Build Spring Boot Applications
Executable Spring Boot archives can be produced with Gradle or Maven.
Gradle
./gradlew clean assemble
The generated JAR is normally placed in the project’s build/libs directory.
Maven
mvn clean package
The generated application archive is normally stored in the target directory.
CI/CD Options for Java Applications
Maintain the Spring Boot Server
Most common maintenance operations can be performed directly from the dashboard.
- Use Configuration Manager to create, upload, edit or remove files.
- Configure mount points and exported data.
- Set custom JVM options through
JAVA_OPTSandJAVA_ARGS. - Review server logs.
- Monitor resource statistics.
- Use Web SSH or a local SSH client for advanced administration.
/home/jelastic/APP/home/jelastic/conf/variables.conf/var/log/home/jelastic/usr/java/latestTo restart the application from SSH, use:
jem service restart
Automatic Scaling for Spring Boot
Automatic Vertical Scaling
Vertical scaling adjusts the resources available to the Spring Boot server within the configured limits. The maximum Java heap size can be adjusted according to the allocated memory.
- 8 cloudlets (1 GiB RAM) can provide a maximum heap of approximately 819 MB.
- 16 cloudlets (2 GiB RAM) can provide a maximum heap of approximately 1638 MB.
Custom JVM memory settings can be defined in /home/jelastic/conf/variables.conf.
Automatic Horizontal Scaling
Horizontal scaling changes the number of application-server instances according to monitoring triggers based on resource usage.
- CPU
- Memory (RAM)
- Network
- Disk I/O
- Disk IOPS
Automatic load balancing
When the application layer is scaled out, an NGINX load balancer can be added automatically and configured for sticky-session load balancing. Other supported balancer stacks can be selected when required.
Newly added nodes are distributed across different hardware servers where possible to improve application availability.
Traffic Encryption with SSL
Spring Boot environments can use platform-level SSL so encrypted traffic is terminated at the load-balancing layer rather than configured inside the application itself.
Custom Ports and HTTP/HTTPS
Spring Boot applications commonly listen on port 8080 for HTTP traffic. Standard application ports are mapped to the public HTTP and HTTPS endpoints automatically.
When an endpoint is created, the corresponding firewall rule is enabled so the selected port can be reached externally.
Expected Result
The Spring Boot application runs in a managed cloud environment that supports multiple deployment formats, CI/CD automation, file and JVM configuration, monitoring, automatic vertical and horizontal scaling, load balancing, SSL and custom-port access.
