From 011fa5d63126c7184f6ff98765b26ce258407df7 Mon Sep 17 00:00:00 2001 From: jihor Date: Mon, 26 Jun 2017 19:18:20 +0300 Subject: [PATCH 1/2] Add option to control management registration, switch AutoServiceRegistrationProperties to use Lombok --- .../AutoServiceRegistrationProperties.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/serviceregistry/AutoServiceRegistrationProperties.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/serviceregistry/AutoServiceRegistrationProperties.java index d489afe8..87a29adb 100644 --- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/serviceregistry/AutoServiceRegistrationProperties.java +++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/serviceregistry/AutoServiceRegistrationProperties.java @@ -2,23 +2,24 @@ package org.springframework.cloud.client.serviceregistry; import org.springframework.boot.context.properties.ConfigurationProperties; +import lombok.Getter; +import lombok.Setter; + /** * @author Spencer Gibb */ @ConfigurationProperties("spring.cloud.service-registry.auto-registration") +@Getter +@Setter public class AutoServiceRegistrationProperties { /** If Auto-Service Registration is enabled, default to true. */ private boolean enabled = true; + /** Whether to register the management as a service, defaults to true */ + private boolean registerManagement = true; + /** Should startup fail if there is no AutoServiceRegistration, default to false. */ private boolean failFast = false; - public boolean isFailFast() { - return failFast; - } - - public void setFailFast(boolean failFast) { - this.failFast = failFast; - } } From 314a42339c8bc1a188ba550ee8b3df548e7481a8 Mon Sep 17 00:00:00 2001 From: jihor Date: Mon, 26 Jun 2017 23:17:49 +0300 Subject: [PATCH 2/2] Switch back from Lombok to plain getters and setters in AutoServiceRegistrationProperties --- .../AutoServiceRegistrationProperties.java | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/serviceregistry/AutoServiceRegistrationProperties.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/serviceregistry/AutoServiceRegistrationProperties.java index 87a29adb..a43c68ad 100644 --- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/serviceregistry/AutoServiceRegistrationProperties.java +++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/serviceregistry/AutoServiceRegistrationProperties.java @@ -2,15 +2,10 @@ package org.springframework.cloud.client.serviceregistry; import org.springframework.boot.context.properties.ConfigurationProperties; -import lombok.Getter; -import lombok.Setter; - /** * @author Spencer Gibb */ @ConfigurationProperties("spring.cloud.service-registry.auto-registration") -@Getter -@Setter public class AutoServiceRegistrationProperties { /** If Auto-Service Registration is enabled, default to true. */ @@ -19,7 +14,22 @@ public class AutoServiceRegistrationProperties { /** Whether to register the management as a service, defaults to true */ private boolean registerManagement = true; + public boolean shouldRegisterManagement() { + return registerManagement; + } + + public void setRegisterManagement(boolean registerManagement) { + this.registerManagement = registerManagement; + } + /** Should startup fail if there is no AutoServiceRegistration, default to false. */ private boolean failFast = false; + public boolean isFailFast() { + return failFast; + } + + public void setFailFast(boolean failFast) { + this.failFast = failFast; + } }