forked from sofastack/sofa-rpc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor consul registry and fix the subscribe bugs. (sofastack#629)
* refactor(registry-consul): refactor consul registry, redesigning the data structure and fixing the subscribe bugs * clean imports * add default port * fix tests * assert until 10s * fix tests * fix notify tests * minor fixes * remove my jenv
- Loading branch information
1 parent
ad8d7de
commit a20537e
Showing
27 changed files
with
842 additions
and
2,466 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
...pl/registry-consul/src/main/java/com/alipay/sofa/rpc/registry/consul/ConsulConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.alipay.sofa.rpc.registry.consul; | ||
|
||
/** | ||
* All constants of the consul registry | ||
* | ||
* @author <a href=mailto:[email protected]>ScienJus</a> | ||
*/ | ||
public class ConsulConstants { | ||
|
||
public static final String CONSUL_SERVICE_NAME_KEY = "consulServiceName"; | ||
|
||
public static final String HEARTBEAT_INTERVAL_KEY = "heartbeat.interval"; | ||
|
||
public static final String HEARTBEAT_CORE_SIZE_KEY = "heartbeat.coreSize"; | ||
|
||
public static final String LOOKUP_INTERVAL_KEY = "lookup.interval"; | ||
|
||
public static final String WATCH_TIMEOUT_KEY = "watch.timeout"; | ||
|
||
public static final String HEALTH_CHECK_TYPE_KEY = "healthCheck.type"; | ||
|
||
public static final String HEALTH_CHECK_TTL_KEY = "healthCheck.ttl"; | ||
|
||
public static final String HEALTH_CHECK_HOST_KEY = "healthCheck.host"; | ||
|
||
public static final String HEALTH_CHECK_PORT_KEY = "healthCheck.port"; | ||
|
||
public static final String HEALTH_CHECK_TIMEOUT_KEY = "healthCheck.timeout"; | ||
|
||
public static final String HEALTH_CHECK_INTERVAL_KEY = "healthCheck.interval"; | ||
|
||
public static final String HEALTH_CHECK_PROTOCOL_KEY = "healthCheck.protocol"; | ||
|
||
public static final String HEALTH_CHECK_PATH_KEY = "healthCheck.path"; | ||
|
||
public static final String HEALTH_CHECK_METHOD_KEY = "healthCheck.method"; | ||
|
||
public static final int DEFAULT_CONSUL_PORT = 8500; | ||
|
||
public static final int DEFAULT_HEARTBEAT_INTERVAL = 3000; | ||
|
||
public static final int DEFAULT_HEARTBEAT_CORE_SIZE = 1; | ||
|
||
public static final int DEFAULT_LOOKUP_INTERVAL = 1000; | ||
|
||
public static final int DEFAULT_WATCH_TIMEOUT = 5; | ||
|
||
public static final ConsulRegistryProperties.HealthCheckType DEFAULT_HEALTH_CHECK_TYPE = ConsulRegistryProperties.HealthCheckType.TTL; | ||
|
||
public static final String DEFAULT_HEALTH_CHECK_TTL = "10s"; | ||
|
||
public static final String DEFAULT_HEALTH_CHECK_TIMEOUT = "1s"; | ||
|
||
public static final String DEFAULT_HEALTH_CHECK_INTERVAL = "5s"; | ||
|
||
public static final String DEFAULT_HEALTH_CHECK_PROTOCOL = "http"; | ||
|
||
public static final String DEFAULT_HEALTH_CHECK_PATH = "/health"; | ||
|
||
public static final String DEFAULT_HEALTH_CHECK_METHOD = "GET"; | ||
} |
Oops, something went wrong.