Table of Contents
Spring Boot lets you to run the same application more than once on a different port number. In this chapter, you will learn about this in detail. Note that the default port number 8080.
1. Custom Port
In the application.properties file, we can set custom port number for the property server.port
server.port = 9090
In the application.yml file, you can find as follows −
server: port: 9090
Random Port
In the application.properties file, we can set random port number for the property server.port
server.port = 0
In the application.yml file, you can find as follows −
server: port: 0
Note − If the server.port number is 0 while starting the Spring Boot application, Tomcat uses the random port number.
Related posts:
Java Program to Implement Regular Falsi Algorithm
SOAP Web service: Upload và Download file sử dụng MTOM trong JAX-WS
Java Program to implement Bit Set
A Guide to the ResourceBundle
HttpClient Connection Management
Java Program to Convert a Decimal Number to Binary Number using Stacks
Quick Guide to Spring Bean Scopes
Jackson – Bidirectional Relationships
Spring Cloud – Adding Angular
Java Program to Implement Suffix Array
Jackson Exceptions – Problems and Solutions
Comparing Long Values in Java
Java Program to Implement Fisher-Yates Algorithm for Array Shuffling
Spring Cloud Bus
Spring Boot Integration Testing with Embedded MongoDB
Period and Duration in Java
Encode/Decode to/from Base64
Java Program to Implement ConcurrentHashMap API
Spring Boot - Zuul Proxy Server and Routing
Java Program to Implement Ternary Search Tree
Java Program to Check whether Undirected Graph is Connected using DFS
Spring Security OAuth Login with WebFlux
Java Program to Implement Cartesian Tree
Apache Commons Collections BidiMap
Error Handling for REST with Spring
Java Program to Implement Circular Doubly Linked List
Introduction to the Java ArrayDeque
JWT – Token-based Authentication trong Jersey 2.x
Java Program to Implement Multi-Threaded Version of Binary Search Tree
Spring Boot: Customize the Jackson ObjectMapper
Introduction to Using FreeMarker in Spring MVC
Guide to CopyOnWriteArrayList