{"action":"created","issue":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/issues/93","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/issues/93/labels{/name}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/issues/93/comments","events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/issues/93/events","html_url":"https://github.com/spring-cloud/spring-cloud-config/issues/93","id":59144790,"number":93,"title":"In Eureka First Bootstrap mode, config data wouldn't load if a client starts on a random port number","user":{"login":"seeksong","id":10931234,"avatar_url":"https://avatars.githubusercontent.com/u/10931234?v=3","gravatar_id":"","url":"https://api.github.com/users/seeksong","html_url":"https://github.com/seeksong","followers_url":"https://api.github.com/users/seeksong/followers","following_url":"https://api.github.com/users/seeksong/following{/other_user}","gists_url":"https://api.github.com/users/seeksong/gists{/gist_id}","starred_url":"https://api.github.com/users/seeksong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seeksong/subscriptions","organizations_url":"https://api.github.com/users/seeksong/orgs","repos_url":"https://api.github.com/users/seeksong/repos","events_url":"https://api.github.com/users/seeksong/events{/privacy}","received_events_url":"https://api.github.com/users/seeksong/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-02-26T21:16:14Z","updated_at":"2015-11-09T14:36:40Z","closed_at":null,"body":"In Eureka First mode, if client starts on a random port (--server.port=0),  the client code will ignore the Eureka setup and always try to load config data from default location (localhost:8888). In my case, I have config server runs on 8810, and the client bootstrap as,\r\n\r\n```\r\nspring.application.name=test-server\r\nserver.port=0\r\n\r\nspring.cloud.config.discovery.enabled=true\r\nspring.cloud.config.discovery.serviceId=config-server\r\n\r\neureka.client.serviceUrl.defaultZone=http://localhost:8020/eureka/\r\neureka.instance.metadataMap.instanceId=${spring.application.name}:${spring.application.instance_id:${random.value}}\r\n```\r\n\r\nHere is the error when my client bootup,\r\n\r\n```\r\n2015-02-26 14:11:30.320 ERROR 21609 --- [           main] c.c.c.ConfigServicePropertySourceLocator : Could not locate PropertySource: I/O error on GET request for \"http://localhost:8888/test-server/default/master\":Connection refused; nested exception is java.net.ConnectException: Connection refused\r\n```"},"comment":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/issues/comments/155080360","html_url":"https://github.com/spring-cloud/spring-cloud-config/issues/93#issuecomment-155080360","issue_url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/issues/93","id":155080360,"user":{"login":"ciberado","id":1154367,"avatar_url":"https://avatars.githubusercontent.com/u/1154367?v=3","gravatar_id":"","url":"https://api.github.com/users/ciberado","html_url":"https://github.com/ciberado","followers_url":"https://api.github.com/users/ciberado/followers","following_url":"https://api.github.com/users/ciberado/following{/other_user}","gists_url":"https://api.github.com/users/ciberado/gists{/gist_id}","starred_url":"https://api.github.com/users/ciberado/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ciberado/subscriptions","organizations_url":"https://api.github.com/users/ciberado/orgs","repos_url":"https://api.github.com/users/ciberado/repos","events_url":"https://api.github.com/users/ciberado/events{/privacy}","received_events_url":"https://api.github.com/users/ciberado/received_events","type":"User","site_admin":false},"created_at":"2015-11-09T14:36:40Z","updated_at":"2015-11-09T14:36:40Z","body":"Looks like this is a regression: using spring-boot-starter-parent:1.2.4.RELEASE on my web services everything is registered correctly basically because the call to the Eureka server is delayed a few seconds after the bootstrapping of the application. \r\n\r\nIf I change it to the 1.3.0RC the web service tries to register on Eureka just after starting, failing miserably in reporting the correct port.\r\n\r\n"}}