Skip to content

Commit c0ef2d1

Browse files
committed
Fix issue with service registration at bootstrap
* Move properties from bootstrap.yml to application.yml * Add caffeine as backing cache provider for client-side load-balancer * Adjust logging levels to provide insight into DiscoveryClient bootstrap * Fix activation of cloud profile
1 parent af750e7 commit c0ef2d1

File tree

4 files changed

+36
-24
lines changed

4 files changed

+36
-24
lines changed

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ dependencies {
131131
implementation('io.pivotal.spring.cloud:spring-cloud-services-starter-service-registry')
132132
implementation('org.springframework.boot:spring-boot-starter-log4j2')
133133
implementation('com.lmax:disruptor:3.4.4')
134+
implementation('com.github.ben-manes.caffeine:caffeine:3.0.2')
134135
implementation('org.apache.httpcomponents:httpclient:4.5.13')
135136
implementation('io.projectreactor:reactor-core:3.4.6')
136137
implementation('io.projectreactor.netty:reactor-netty:1.0.7')

src/main/resources/application.yml

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,9 @@ cf:
33
#- pws: cf-butler-interesting-eagle.cfapps.io
44
sslValidationSkipped: false
55

6-
management:
7-
endpoints:
8-
web:
9-
exposure:
10-
include: info,health,metrics,scheduledtasks,loggers,prometheus
11-
endpoint:
12-
health:
13-
show-details: always
14-
metrics:
15-
enabled: true
16-
prometheus:
17-
enabled: true
18-
196
spring:
7+
application:
8+
name: cf-hoover
209
codec:
2110
max-in-memory-size: 512000000
2211
cloud:
@@ -25,12 +14,36 @@ spring:
2514
discovery:
2615
enabled: false
2716

17+
eureka:
18+
client:
19+
serviceUrl:
20+
defaultZone: ${vcap.services.hooverRegistry.credentials.uri:http://localhost:8761}/eureka/
21+
22+
management:
23+
endpoints:
24+
web:
25+
exposure:
26+
include: health,info,httptrace,loggers,metrics,prometheus
27+
endpoint:
28+
health:
29+
show-details: always
30+
info:
31+
git:
32+
mode: full
33+
2834
---
2935
spring:
30-
profiles: cloud
36+
config:
37+
activate:
38+
on-profile: cloud
3139

3240
cloud:
3341
config:
3442
enabled: true
3543
discovery:
3644
enabled: true
45+
46+
management:
47+
cloudfoundry:
48+
enabled: true
49+
skip-ssl-validation: true

src/main/resources/bootstrap.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/main/resources/log4j2-spring.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,14 @@
2828
<AppenderRef ref="RollingFile" />
2929
</Root>
3030

31-
<Logger name="org.springframework" level="warn" />
32-
<!-- <Logger name="reactor.core" level="debug" /> -->
31+
<Logger name="com.netflix.discovery" lever="debug" />
32+
33+
<!--
34+
<Logger name="io.pivotal.cfapp" level="trace" />
35+
<Logger name="reactor.core" level="debug" />
36+
<Logger name="org.springframework" level="debug" />
37+
-->
38+
3339
</Loggers>
3440

3541
</Configuration>

0 commit comments

Comments
 (0)