Eureka Client running with name "UNKNOWN" in eureka server UI
Asked Answered
B

3

8

I created a Eureka server spring boot application. It is properly loaded. After that I am trying to create a Eureka client.But it is not getting listed in eureka server UI. I am adding my client application details.

My main controller class file is as below,

@SpringBootApplication
@EnableDiscoveryClient
public class ZEurekaClientServiceApplication {

public static void main(String[] args) {
    SpringApplication.run(ZEurekaClientServiceApplication.class, args);
}
}

And my pom.xml contains the ,

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-eureka</artifactId>
</dependency>

And

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>${spring-cloud.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

And my application.properties file containing,

eureka.client.serviceUrl.defaultZone=http://localhost:8071/eureka
eureka.client.register-with-eureka=true
eureka.client.fetch-registry=true

When It client is running , the eureka server UI not showing it's name. ONly showing UNKNOWN as application. I am adding its screenshot below.enter image description here

What I need to display the application name instead of "UNKNOWN" in the eureka server UI? Is there is any additional settings to add application name?

Bevel answered 4/11, 2017 at 6:47 Comment(0)
H
16

You can specify the application name by setting it either in your application.yml or in your application.properties.

For application.yml:

spring:
  application:
    name: {YOUR_APPLICATION_NAME}

For application.properties:

spring.application.name={YOUR_APPLICATION_NAME}
Holiday answered 6/11, 2017 at 6:36 Comment(1)
Yes. I got it.its working. Thank you for your response.Bevel
R
0

Add

spring.application.name=(Your Name)

In application.properties file

Resignation answered 25/7, 2023 at 6:3 Comment(0)
H
-1

In my case, the property (yml) file could not be copied to the target folder due to a build problem.

If this happens, none of the yml properties will load and the spring boot program will run with the default configuration.

For example, Tomcat started with 8080, not any port you specified in the yml file

enter image description here

Helbonnah answered 29/6, 2022 at 4:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.