Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-boot-admin
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-boot-admin
Commits
d0ab4e73
Commit
d0ab4e73
authored
Mar 19, 2018
by
Johannes Edmeier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set default managemnt-context-path for DefaultServiceInstanceConverter to `actuator`
parent
6e8173ef
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
11 deletions
+33
-11
server-discovery.adoc
...g-boot-admin-docs/src/main/asciidoc/server-discovery.adoc
+1
-1
application.yml
...ot-admin-sample-eureka/src/main/resources/application.yml
+24
-2
DefaultServiceInstanceConverter.java
...min/server/discovery/DefaultServiceInstanceConverter.java
+1
-1
DefaultServiceInstanceConverterTest.java
...server/discovery/DefaultServiceInstanceConverterTest.java
+3
-3
EurekaServiceInstanceConverterTest.java
.../server/discovery/EurekaServiceInstanceConverterTest.java
+2
-2
InstanceDiscoveryListenerTest.java
...admin/server/discovery/InstanceDiscoveryListenerTest.java
+2
-2
No files found.
spring-boot-admin-docs/src/main/asciidoc/server-discovery.adoc
View file @
d0ab4e73
...
...
@@ -79,7 +79,7 @@ user.password
| spring.boot.admin.discovery.converter.management-context-path
| Will be appended to the service-url of the discovered service when the management-url is converted by the `DefaultServiceInstanceConverter`.
|
|
`/actuator`
| spring.boot.admin.discovery.converter.health-endpoint-path
| Will be appended to the management-url of the discovered service when the health-url is converted by the `DefaultServiceInstanceConverter`.
...
...
spring-boot-admin-samples/spring-boot-admin-sample-eureka/src/main/resources/application.yml
View file @
d0ab4e73
spring
:
application
:
name
:
eureka-example
name
:
spring-boot-admin-sample-eureka
profiles
:
active
:
-
secure
# tag::configuration-eureka[]
eureka
:
#<1>
instance
:
leaseRenewalIntervalInSeconds
:
10
health-check-url-path
:
/actuator/health
client
:
registryFetchIntervalSeconds
:
5
serviceUrl
:
...
...
@@ -16,7 +21,24 @@ management:
web
:
exposure
:
include
:
"
*"
#<2>
# end::configuration-eureka[]
endpoint
:
health
:
show-details
:
ALWAYS
# end::configuration-eureka[]
---
spring
:
profiles
:
insecure
---
spring
:
profiles
:
secure
security
:
user
:
name
:
"
user"
password
:
"
password"
eureka
:
instance
:
metadata-map
:
user.name
:
"
user"
#These two are needed so that the server
user.password
:
"
password"
#can access the protected client endpoints
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/discovery/DefaultServiceInstanceConverter.java
View file @
d0ab4e73
...
...
@@ -47,7 +47,7 @@ public class DefaultServiceInstanceConverter implements ServiceInstanceConverter
* Default context-path to be appended to the url of the discovered service for the
* managment-url.
*/
private
String
managementContextPath
=
""
;
private
String
managementContextPath
=
"
/actuator
"
;
/**
* Default path of the health-endpoint to be used for the health-url of the discovered service.
*/
...
...
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/discovery/DefaultServiceInstanceConverterTest.java
View file @
d0ab4e73
/*
* Copyright 2014-201
7
the original author or authors.
* Copyright 2014-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -35,8 +35,8 @@ public class DefaultServiceInstanceConverterTest {
assertThat
(
registration
.
getName
()).
isEqualTo
(
"test"
);
assertThat
(
registration
.
getServiceUrl
()).
isEqualTo
(
"http://localhost:80/"
);
assertThat
(
registration
.
getManagementUrl
()).
isEqualTo
(
"http://localhost:80/"
);
assertThat
(
registration
.
getHealthUrl
()).
isEqualTo
(
"http://localhost:80/health"
);
assertThat
(
registration
.
getManagementUrl
()).
isEqualTo
(
"http://localhost:80/
actuator
"
);
assertThat
(
registration
.
getHealthUrl
()).
isEqualTo
(
"http://localhost:80/
actuator/
health"
);
}
@Test
...
...
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/discovery/EurekaServiceInstanceConverterTest.java
View file @
d0ab4e73
/*
* Copyright 2014-201
7
the original author or authors.
* Copyright 2014-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -60,7 +60,7 @@ public class EurekaServiceInstanceConverterTest {
Registration
registration
=
new
EurekaServiceInstanceConverter
().
convert
(
service
);
assertThat
(
registration
.
getManagementUrl
()).
isEqualTo
(
"http://localhost:80/"
);
assertThat
(
registration
.
getManagementUrl
()).
isEqualTo
(
"http://localhost:80/
actuator
"
);
}
@Test
...
...
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/discovery/InstanceDiscoveryListenerTest.java
View file @
d0ab4e73
...
...
@@ -149,8 +149,8 @@ public class InstanceDiscoveryListenerTest {
StepVerifier
.
create
(
registry
.
getInstances
()).
assertNext
(
application
->
{
Registration
registration
=
application
.
getRegistration
();
assertThat
(
registration
.
getHealthUrl
()).
isEqualTo
(
"http://localhost:80/health"
);
assertThat
(
registration
.
getManagementUrl
()).
isEqualTo
(
"http://localhost:80/"
);
assertThat
(
registration
.
getHealthUrl
()).
isEqualTo
(
"http://localhost:80/
actuator/
health"
);
assertThat
(
registration
.
getManagementUrl
()).
isEqualTo
(
"http://localhost:80/
actuator
"
);
assertThat
(
registration
.
getServiceUrl
()).
isEqualTo
(
"http://localhost:80/"
);
assertThat
(
registration
.
getName
()).
isEqualTo
(
"service"
);
}).
verifyComplete
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment