Mr.DevEng
Mr.DevEng

Reputation: 2421

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?

Upvotes: 8

Views: 8127

Answers (3)

Harshil Ahir
Harshil Ahir

Reputation: 1

Add

spring.application.name=(Your Name)

In application.properties file

Upvotes: 0

afshar
afshar

Reputation: 703

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

Upvotes: -1

LHCHIN
LHCHIN

Reputation: 4009

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}

Upvotes: 16

Related Questions