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
c973e3af
Commit
c973e3af
authored
Dec 09, 2015
by
Johannes Edmeier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename spring.boot.admin.context-path to spring.boot.admin.api-path on client-side.
parent
bbd51513
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
15 deletions
+16
-15
index.adoc
spring-boot-admin-docs/src/main/asciidoc/index.adoc
+2
-2
AdminProperties.java
...ava/de/codecentric/boot/admin/config/AdminProperties.java
+10
-6
ApplicationRegistrator.java
...decentric/boot/admin/services/ApplicationRegistrator.java
+4
-7
No files found.
spring-boot-admin-docs/src/main/asciidoc/index.adoc
View file @
c973e3af
...
...
@@ -187,8 +187,8 @@ The Spring Boot Admin Client registers the application at the admin server. This
| URL of the spring-boot-admin application to register at. This triggers the AutoConfiguration. *Mandatory*.
|
| spring.boot.admin.
context
-path
|
Context
-path of registration endpoint at your admin server.
| spring.boot.admin.
api
-path
|
Http
-path of registration endpoint at your admin server.
| `"api/applications"`
| spring.boot.admin.username
...
...
spring-boot-admin-starter-client/src/main/java/de/codecentric/boot/admin/config/AdminProperties.java
View file @
c973e3af
...
...
@@ -26,9 +26,9 @@ public class AdminProperties {
private
String
url
;
/**
* The admin
servers context
path.
* The admin
rest-apis
path.
*/
private
String
context
Path
=
"api/applications"
;
private
String
api
Path
=
"api/applications"
;
/**
* Time interval (in ms) the registration is repeated
...
...
@@ -58,12 +58,16 @@ public class AdminProperties {
return
url
;
}
public
String
getContextPath
(
)
{
return
context
Path
;
public
void
setApiPath
(
String
apiPath
)
{
this
.
apiPath
=
api
Path
;
}
public
void
setContextPath
(
String
contextPath
)
{
this
.
contextPath
=
contextPath
;
public
String
getApiPath
()
{
return
apiPath
;
}
public
String
getAdminUrl
()
{
return
url
+
"/"
+
apiPath
;
}
public
int
getPeriod
()
{
...
...
spring-boot-admin-starter-client/src/main/java/de/codecentric/boot/admin/services/ApplicationRegistrator.java
View file @
c973e3af
...
...
@@ -70,12 +70,11 @@ public class ApplicationRegistrator {
*/
public
boolean
register
()
{
Application
self
=
null
;
String
adminUrl
=
admin
.
getUrl
()
+
'/'
+
admin
.
getContextPath
();
try
{
self
=
createApplication
();
@SuppressWarnings
(
"rawtypes"
)
ResponseEntity
<
Map
>
response
=
template
.
postForEntity
(
admin
Url
,
ResponseEntity
<
Map
>
response
=
template
.
postForEntity
(
admin
.
getAdminUrl
()
,
new
HttpEntity
<
Application
>(
self
,
HTTP_HEADERS
),
Map
.
class
);
if
(
response
.
getStatusCode
().
equals
(
HttpStatus
.
CREATED
))
{
...
...
@@ -94,7 +93,7 @@ public class ApplicationRegistrator {
}
}
catch
(
Exception
ex
)
{
LOGGER
.
warn
(
"Failed to register application as {} at spring-boot-admin ({}): {}"
,
self
,
admin
Url
,
ex
.
getMessage
());
admin
.
getAdminUrl
()
,
ex
.
getMessage
());
}
return
false
;
...
...
@@ -103,15 +102,13 @@ public class ApplicationRegistrator {
public
void
deregister
()
{
String
id
=
registeredId
.
get
();
if
(
id
!=
null
)
{
String
adminUrl
=
admin
.
getUrl
()
+
'/'
+
admin
.
getContextPath
()
+
"/"
+
id
;
try
{
template
.
delete
(
admin
Url
);
template
.
delete
(
admin
.
getAdminUrl
()
+
"/"
+
id
);
registeredId
.
set
(
null
);
}
catch
(
Exception
ex
)
{
LOGGER
.
warn
(
"Failed to deregister application (id={}) at spring-boot-admin ({}): {}"
,
id
,
admin
Url
,
ex
.
getMessage
());
id
,
admin
.
getAdminUrl
()
,
ex
.
getMessage
());
}
}
}
...
...
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