Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eureka Client running with name "UNKNOWN" in eureka server UI

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?

like image 602
Mr.DevEng Avatar asked Jan 03 '23 06:01

Mr.DevEng


1 Answers

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}
like image 64
LHCHIN Avatar answered Jan 13 '23 13:01

LHCHIN