From ac846dfe084411bf5241f12fe02a038c7dd47d71 Mon Sep 17 00:00:00 2001 From: chuntaojun Date: Fri, 14 Jun 2019 16:56:28 +0800 Subject: [PATCH] fix(nacos-api): fix some property name --- .../alibaba/nacos/api/PropertyKeyConst.java | 4 +- .../nacos/api/annotation/NacosProperties.java | 54 +++++++++++++++++++ 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/api/src/main/java/com/alibaba/nacos/api/PropertyKeyConst.java b/api/src/main/java/com/alibaba/nacos/api/PropertyKeyConst.java index 984591bdf..4cb6b3e75 100644 --- a/api/src/main/java/com/alibaba/nacos/api/PropertyKeyConst.java +++ b/api/src/main/java/com/alibaba/nacos/api/PropertyKeyConst.java @@ -46,9 +46,9 @@ public class PropertyKeyConst { public final static String ENCODE = "encode"; - public final static String CONFIG_LONG_POLL_TIMEOUT = "config.long-poll.timeout"; + public final static String CONFIG_LONG_POLL_TIMEOUT = "configLongPollTimeout"; - public final static String CONFIG_RETRY_TIME = "config.retry.time"; + public final static String CONFIG_RETRY_TIME = "configRetryTime"; public final static String MAX_RETRY = "maxRetry"; diff --git a/api/src/main/java/com/alibaba/nacos/api/annotation/NacosProperties.java b/api/src/main/java/com/alibaba/nacos/api/annotation/NacosProperties.java index a6bd2ad6d..0150e3d57 100644 --- a/api/src/main/java/com/alibaba/nacos/api/annotation/NacosProperties.java +++ b/api/src/main/java/com/alibaba/nacos/api/annotation/NacosProperties.java @@ -76,6 +76,21 @@ public @interface NacosProperties { */ String ENCODE = "encode"; + /** + * The property name of "long-poll.timeout" + */ + String CONFIG_LONG_POLL_TIMEOUT = "configLongPollTimeout"; + + /** + * The property name of "config.retry.time" + */ + String CONFIG_RETRY_TIME = "configRetryTime"; + + /** + * The property name of "maxRetry" + */ + String MAX_RETRY = "maxRetry"; + /** * The placeholder of endpoint, the value is "${nacos.endpoint:}" */ @@ -116,6 +131,21 @@ public @interface NacosProperties { */ String ENCODE_PLACEHOLDER = "${" + PREFIX + ENCODE + ":UTF-8}"; + /** + * The placeholder of {@link NacosProperties#CONFIG_LONG_POLL_TIMEOUT config.long-poll.timeout}, the value is "${nacos.config.long-poll.timeout:30000}" + */ + String CONFIG_LONG_POLL_TIMEOUT_PLACEHOLDER = "${" + PREFIX + CONFIG_LONG_POLL_TIMEOUT + ":30000}"; + + /** + * The placeholder of {@link NacosProperties#CONFIG_RETRY_TIME config.retry.time}, the value is "${nacos.config.retry.time:2000}" + */ + String CONFIG_RETRY_TIME_PLACEHOLDER = "${" + PREFIX + CONFIG_RETRY_TIME + ":2000}"; + + /** + * The placeholder of {@link NacosProperties#MAX_RETRY maxRetry}, the value is "${nacos.maxRetry:3}" + */ + String MAX_RETRY_PLACEHOLDER = "${" + PREFIX + MAX_RETRY + ":3}"; + /** * The property of "endpoint" * @@ -180,4 +210,28 @@ public @interface NacosProperties { */ String encode() default ENCODE_PLACEHOLDER; + /** + * The property of "config.long-poll.timeout" + * + * @return "30000ms" as default value + * @see #CONFIG_LONG_POLL_TIMEOUT_PLACEHOLDER + */ + String configLongPollTimeout() default CONFIG_LONG_POLL_TIMEOUT_PLACEHOLDER; + + /** + * The property of "config.retry.time" + * + * @return "2000ms" as default value + * @see #CONFIG_RETRY_TIME_PLACEHOLDER + */ + String configRetryTime() default CONFIG_RETRY_TIME_PLACEHOLDER; + + /** + * The property of "maxRetry" + * + * @return "3" as default value + * @see #MAX_RETRY + */ + String maxRetry() default MAX_RETRY_PLACEHOLDER; + }