-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update cf discovery defaults in service discovery #63
base: main
Are you sure you want to change the base?
update cf discovery defaults in service discovery #63
Conversation
private boolean isInternalDomain(String url) { | ||
return url != null && url.endsWith(INTERNAL_DOMAIN); | ||
protected String getRouteURL(List<String> urls) { | ||
return urls.stream().filter(this::isInternalDomain).findFirst().orElse(""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use stream apis please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, changed it
@@ -85,15 +86,25 @@ protected ServiceInstance mapApplicationInstanceToServiceInstance( | |||
String instanceId = applicationId + "." + applicationIndex; | |||
String name = applicationDetail.getName(); | |||
String url = applicationDetail.getUrls().size() > 0 | |||
? applicationDetail.getUrls().get(0) : null; | |||
boolean secure = (url + "").toLowerCase().startsWith("https"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you change this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- getUrls().get(0) always returns the external URL. It's not picking up the apps.internal url when we use CloudFoundryAppServiceReactiveDiscoveryClient
- protocol information is never returned as part of the cf-client call. URL info always gets returned without the protocol.
...ngframework/cloud/cloudfoundry/discovery/reactive/SimpleDnsBasedReactiveDiscoveryClient.java
Show resolved
Hide resolved
@making or @scottfrederick wondering if you think these changes make sense. |
@spencergibb is this good to go? |
@srinivasa-vasu I'm waiting for comment from team members. |
@srinivasa-vasu |
Hope this helps. |
@srinivasa-vasu Thanks for the clarification. Is this correct? I think the change makes sense. |
@making Yes, that's right + the default properties update. |
@spencergibb can we merge this as @making seems to be fine with the changes done? |
spring.cloud.cloudfoundry.discovery.default-server-port
andspring.cloud.cloudfoundry.discovery.internal-domain
if passed externally.