Eureka installation

import eureka-client

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// build.gradle.kts

repositories {
// ...
maven (url = "https://repo.spring.io/milestone")
}

dependencies {

// ...
implementation ("org.springframework.cloud:spring-cloud-starter-netflix-eureka-client")
}

dependencyManagement {
imports {
mavenBom("org.springframework.cloud:spring-cloud-dependencies:2021.0.1")
}
}

let’s inform that we will use client clent in this project through @EnableEurekaClient annotation

1
2
3
4
5
6
7
8
9
// GatewayModuleApplication.kt

// ...
@EnableEurekaClient
class GatewayModuleApplication

fun main(args: Array<String>) {
runApplication<GatewayModuleApplication>(*args)
}

set the name in each bootstrap.yml

1
2
3
spring:
application:
name: gateway_module
Share