This guide describes how to set up a Spring Boot microservice and integrate it in the microservice system landscape.
...
A basic understanding of building an application with Spring Boot and building Java projects with Maven is required.
Dependencies
Anchor | ||||
---|---|---|---|---|
|
The following dependencies are necessary to be able to integrate a Spring Boot microservice in the system landscape.
...
Jolokia is an HTTP/JSON bridge for remote JMX access. This dependency is needed to be able to access a services's JMX beans from the admin-service user interface.
spring-cloud-starter-config
(https://cloud.spring.io/spring-cloud-config/)
...
The configuration parameter server.port
specifies at which port the service should be started (see also Overview of Microservices). The port is also used as spring.application.index
. The spring.application.name
is the service name with which it signs in to Discovery. If multiple services have the same name, the Discovery Service treats them as a service group, even if the instances are running on different hosts and ports. However, if you plan to have the same service running with different configurations for different applications in a system landscape, then these should have different names. One example would be to use the gateway service once with NTLM authentication and once with basic authentication.
Anchor | ||||
---|---|---|---|---|
|
Configuration Files
The two most important configuration files are bootstrap.yml
and application.yml
. In a service, both should be in the directory src/main/resources.
...
- Jolokia
- Spring Cloud Config
- Spring Cloud Config - Client Side Usage
- Spring Cloud Netflix
- Spring Boot features - Profiles
- Service Registration and Discovery
- Spring Cloud Context: Application Context Services
...