コード例 #1
0
  public EurekaInstanceConfig eurekaInstanceConfigBean() {

    EurekaInstanceConfigBean config = new EurekaInstanceConfigBean();
    config.setNonSecurePort(8080);
    config.setPreferIpAddress(false);
    config.setIpAddress("127.0.0.1");
    config.setAppname("openamtest");
    config.setHostname("localhost");
    config.getMetadataMap().put("instanceId", "openamtest1");

    return config;
  }
コード例 #2
0
 @Bean
 public EurekaInstanceConfigBean eurekaInstanceConfigBean() {
   EurekaInstanceConfigBean config = new EurekaInstanceConfigBean();
   int port = sidecarProperties.getPort();
   config.setNonSecurePort(port);
   String scheme = config.getSecurePortEnabled() ? "https" : "http";
   config.setStatusPageUrl(
       scheme
           + "://"
           + config.getHostname()
           + ":"
           + this.serverPort
           + config.getStatusPageUrlPath());
   config.setHealthCheckUrl(
       scheme
           + "://"
           + config.getHostname()
           + ":"
           + this.serverPort
           + config.getHealthCheckUrlPath());
   config.setHomePageUrl(
       scheme + "://" + config.getHostname() + ":" + port + config.getHomePageUrlPath());
   return config;
 }