Skip to content

Instantly share code, notes, and snippets.

@thinkmicroservices
Created February 25, 2020 00:47
Show Gist options
  • Save thinkmicroservices/9cb71dd850918f5f8b5d3e6e8e73ed8a to your computer and use it in GitHub Desktop.
Save thinkmicroservices/9cb71dd850918f5f8b5d3e6e8e73ed8a to your computer and use it in GitHub Desktop.
discovery-service:DiscoveryService.java
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