Commit 6de3723a by Thomas Bosch

new spring-boot-admin client

parent fdb85b9d
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<dependency> <dependency>
<groupId>de.codecentric</groupId> <groupId>de.codecentric</groupId>
<artifactId>spring-boot-starter-admin-client</artifactId> <artifactId>spring-boot-starter-admin-client</artifactId>
<version>1.0.0.RC1</version> <version>1.0.0.RC3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
......
...@@ -28,9 +28,9 @@ public class RegistryController { ...@@ -28,9 +28,9 @@ public class RegistryController {
@RequestMapping(value = "/api/applications", method = RequestMethod.POST) @RequestMapping(value = "/api/applications", method = RequestMethod.POST)
@ResponseBody @ResponseBody
public void register(@RequestBody Application app) { public Application register(@RequestBody Application app) {
LOGGER.info("Register application with ID '{}' and URL '{}'", app.getId(), app.getUrl()); LOGGER.info("Register application with ID '{}' and URL '{}'", app.getId(), app.getUrl());
registry.register(app); return registry.register(app);
} }
@RequestMapping(value = "/api/application/{id}", method = RequestMethod.GET) @RequestMapping(value = "/api/application/{id}", method = RequestMethod.GET)
......
...@@ -24,11 +24,11 @@ public class ApplicationRegistry { ...@@ -24,11 +24,11 @@ public class ApplicationRegistry {
* @param app * @param app
* The Application. * The Application.
*/ */
public void register(Application app) { public Application register(Application app) {
Validate.notNull(app, "Application must not be null"); Validate.notNull(app, "Application must not be null");
Validate.notNull(app.getId(), "Application ID must not be null"); Validate.notNull(app.getId(), "Application ID must not be null");
Validate.notNull(app.getUrl(), "Application URL must not be null"); Validate.notNull(app.getUrl(), "Application URL must not be null");
registry.put(app.getId(), app); return registry.put(app.getId(), app);
} }
/** /**
......
...@@ -2,3 +2,5 @@ spring.resources.cachePeriod=3600 ...@@ -2,3 +2,5 @@ spring.resources.cachePeriod=3600
server.port=8080 server.port=8080
info.id=spring-boot-admin info.id=spring-boot-admin
info.version=1.0.0-SNAPSHOT info.version=1.0.0-SNAPSHOT
spring.boot.admin.url=http://localhost:8080
logging.file=/tmp/log.log
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment