mirror of
https://gitee.com/san-bing/JChargePointProtocol
synced 2026-05-05 02:19:56 +08:00
配置手册
This commit is contained in:
@@ -164,6 +164,14 @@ service:
|
||||
type: "${SERVICE_TYPE:monolith}"
|
||||
# 可自定义的服务ID,如果不指定,则默认为HOSTNAME
|
||||
id: "${SERVICE_ID:}"
|
||||
thread-pool:
|
||||
sharding:
|
||||
hash_function_name: "${THREAD_POOL_SHARDING_HASH_FUNCTION_NAME:murmur3_128}" # murmur3_32, murmur3_128 or sha256
|
||||
parallelism: "${THREAD_POOL_SHARDING_PARALLELISM:8}"
|
||||
stats-print-interval-ms: "${THREAD_POOL_SHARDING_STATS_PRINT_INTERVAL_MS:10000}"
|
||||
downlink:
|
||||
rpc:
|
||||
type: "${DOWNLINK_RPC_TYPE:grpc}" # rest or grpc
|
||||
protocol:
|
||||
sessions:
|
||||
default-inactivity-timeout-in-sec: "${PROTOCOLS_SESSIONS_DEFAULT_INACTIVITY_TIMEOUT_IN_SEC:600}"
|
||||
@@ -260,12 +268,3 @@ service:
|
||||
buffer-memory: "${PROTOCOLS_YUNKUAICHONGV160_FORWARD_BUFFER_MEMORY:33554432}"
|
||||
other-properties: "${PROTOCOLS_YUNKUAICHONGV160_FORWARD_QUEUE_KAFKA_OTHER_PROPERTIES:}"
|
||||
|
||||
thread-pool:
|
||||
sharding:
|
||||
hash_function_name: "${THREAD_POOL_SHARDING_HASH_FUNCTION_NAME:murmur3_128}" # murmur3_32, murmur3_128 or sha256
|
||||
parallelism: "${THREAD_POOL_SHARDING_PARALLELISM:8}"
|
||||
stats-print-interval-ms: "${THREAD_POOL_SHARDING_STATS_PRINT_INTERVAL_MS:10000}"
|
||||
|
||||
downlink:
|
||||
rpc:
|
||||
type: "${DOWNLINK_RPC_TYPE:grpc}" # rest or grpc
|
||||
@@ -22,7 +22,7 @@ import static sanbing.jcpp.infrastructure.proto.ProtoConverter.toTracerProto;
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
@ConditionalOnExpression("'${downlink.rpc.type:null}'=='grpc'")
|
||||
@ConditionalOnExpression("'${service.downlink.rpc.type:null}'=='grpc'")
|
||||
public class GrpcDownlinkCallService extends DownlinkCallService {
|
||||
|
||||
@Resource
|
||||
|
||||
@@ -26,7 +26,7 @@ import static sanbing.jcpp.infrastructure.util.trace.TracerContextUtil.*;
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
@ConditionalOnExpression("'${downlink.rpc.type:null}'=='rest'")
|
||||
@ConditionalOnExpression("'${service.downlink.rpc.type:null}'=='rest'")
|
||||
public class RestDownlinkCallService extends DownlinkCallService {
|
||||
|
||||
@Resource
|
||||
|
||||
@@ -30,10 +30,10 @@ import static sanbing.jcpp.infrastructure.util.JCPPHashUtil.hash;
|
||||
@Component
|
||||
@Slf4j
|
||||
public class ShardingThreadPool {
|
||||
@Value("${thread-pool.sharding.hash_function_name:murmur3_128}")
|
||||
@Value("${service.thread-pool.sharding.hash_function_name:murmur3_128}")
|
||||
private String hashFunctionName;
|
||||
|
||||
@Value("${thread-pool.sharding.parallelism:8}")
|
||||
@Value("${service.thread-pool.sharding.parallelism:8}")
|
||||
private int parallelism;
|
||||
|
||||
private HashFunction hashFunction;
|
||||
@@ -53,7 +53,7 @@ public class ShardingThreadPool {
|
||||
}
|
||||
}
|
||||
|
||||
@Scheduled(fixedDelayString = "${thread-pool.sharding.stats-print-interval-ms:10000}")
|
||||
@Scheduled(fixedDelayString = "${service.thread-pool.sharding.stats-print-interval-ms:10000}")
|
||||
public void printStats() {
|
||||
executorServiceMap.forEach((k, v) -> {
|
||||
|
||||
|
||||
@@ -40,6 +40,11 @@ service:
|
||||
type: "${SERVICE_TYPE:protocol}"
|
||||
# 可自定义的服务ID,如果不指定,则默认为HOSTNAME
|
||||
id: "${SERVICE_ID:}"
|
||||
thread-pool:
|
||||
sharding:
|
||||
hash_function_name: "${THREAD_POOL_SHARDING_HASH_FUNCTION_NAME:murmur3_128}" # murmur3_32, murmur3_128 or sha256
|
||||
parallelism: "${THREAD_POOL_SHARDING_PARALLELISM:8}"
|
||||
stats-print-interval-ms: "${THREAD_POOL_SHARDING_STATS_PRINT_INTERVAL_MS:10000}"
|
||||
protocol:
|
||||
sessions:
|
||||
default-inactivity-timeout-in-sec: "${PROTOCOLS_SESSIONS_DEFAULT_INACTIVITY_TIMEOUT_IN_SEC:600}"
|
||||
@@ -192,9 +197,3 @@ queue:
|
||||
enabled: "${QUEUE_APP_STATS_ENABLED:true}"
|
||||
print-interval-ms: "${QUEUE_APP_STATS_PRINT_INTERVAL_MS:60000}"
|
||||
|
||||
thread-pool:
|
||||
sharding:
|
||||
hash_function_name: "${THREAD_POOL_SHARDING_HASH_FUNCTION_NAME:murmur3_128}" # murmur3_32, murmur3_128 or sha256
|
||||
parallelism: "${THREAD_POOL_SHARDING_PARALLELISM:8}"
|
||||
stats-print-interval-ms: "${THREAD_POOL_SHARDING_STATS_PRINT_INTERVAL_MS:10000}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user