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 Perform integer Partition for a Specific Case
Spring Boot Integration Testing with Embedded MongoDB
CyclicBarrier in Java
Java Program to Find the Longest Subsequence Common to All Sequences in a Set of Sequences
Jackson – Unmarshall to Collection/Array
Giới thiệu Google Guice – Dependency injection (DI) framework
Java Program to Implement LinkedHashSet API
Java Program to Find the Edge Connectivity of a Graph
Spring Boot with Multiple SQL Import Files
Java Program to Evaluate an Expression using Stacks
MyBatis with Spring
Lập trình đa luồng với CompletableFuture trong Java 8
Runnable vs. Callable in Java
Guide to @ConfigurationProperties in Spring Boot
Java Program to Implement Lloyd’s Algorithm
An Example of Load Balancing with Zuul and Eureka
Java Program to Find Nearest Neighbor for Dynamic Data Set
Hướng dẫn sử dụng Java Generics
Sao chép các phần tử của một mảng sang mảng khác như thế nào?
Java Program to Implement AVL Tree
Java Program to Represent Graph Using Incidence List
Java Program to Implement Network Flow Problem
Java Program to Implement Unrolled Linked List
Spring Data JPA @Query
Toán tử trong java
JPA/Hibernate Persistence Context
Call Methods at Runtime Using Java Reflection
Hướng dẫn Java Design Pattern – Abstract Factory
Java Program to Perform Searching Based on Locality of Reference
Class Loaders in Java
Java Map With Case-Insensitive Keys
Date Time trong Java 8