Commit 6de3723a by Thomas Bosch

new spring-boot-admin client

parent fdb85b9d
......@@ -15,7 +15,7 @@
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-starter-admin-client</artifactId>
<version>1.0.0.RC1</version>
<version>1.0.0.RC3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
......
......@@ -28,9 +28,9 @@ public class RegistryController {
@RequestMapping(value = "/api/applications", method = RequestMethod.POST)
@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());
registry.register(app);
return registry.register(app);
}
@RequestMapping(value = "/api/application/{id}", method = RequestMethod.GET)
......
......@@ -24,11 +24,11 @@ public class ApplicationRegistry {
* @param app
* The Application.
*/
public void register(Application app) {
public Application register(Application app) {
Validate.notNull(app, "Application must not be null");
Validate.notNull(app.getId(), "Application ID 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
server.port=8080
info.id=spring-boot-admin
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