Created
February 25, 2020 00:47
-
-
Save thinkmicroservices/9cb71dd850918f5f8b5d3e6e8e73ed8a to your computer and use it in GitHub Desktop.
discovery-service:DiscoveryService.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.thinkmicroservices.ri.spring.discovery; | |
import javax.annotation.PostConstruct; | |
import lombok.extern.slf4j.Slf4j; | |
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; | |
@EnableEurekaServer | |
@SpringBootApplication | |
@Slf4j | |
public class DiscoveryServiceApplication { | |
@Value("${configuration.source:DEFAULT}") | |
String configSource; | |
@Value ("${spring.application.name:NOT-SET}") | |
private String serviceName; | |
public static void main(String[] args) { | |
SpringApplication.run(DiscoveryServiceApplication.class, args); | |
} | |
@PostConstruct | |
private void displayInfo() { | |
log.info("Service-Name:{}, configuration.source={}", serviceName, configSource); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment