Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save thinkmicroservices/ab89cf45b3d02dd7eb0b3fd62496a6cc to your computer and use it in GitHub Desktop.

Select an option

Save thinkmicroservices/ab89cf45b3d02dd7eb0b3fd62496a6cc to your computer and use it in GitHub Desktop.
package com.thinkmicroservices.ri.spring.web;
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.client.discovery.EnableDiscoveryClient;
@EnableDiscoveryClient
@SpringBootApplication
@Slf4j
public class ContentService {
@Value("${configuration.source:DEFAULT}")
String configSource;
@Value("${spring.application.name:NOT-SET}")
private String serviceName;
public static void main(String[] args) {
SpringApplication.run(ContentService.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