mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2025-09-04 03:26:31 +00:00
update 重构 将系统内置配置放置到common包内独立加载 不允许用户随意修改
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package org.dromara.common.dubbo.config;
|
||||
|
||||
import org.dromara.common.core.factory.YmlPropertySourceFactory;
|
||||
import org.dromara.common.dubbo.properties.DubboCustomProperties;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
|
||||
/**
|
||||
* dubbo 配置类
|
||||
*/
|
||||
@AutoConfiguration
|
||||
@EnableConfigurationProperties(DubboCustomProperties.class)
|
||||
@PropertySource(value = "classpath:common-dubbo.yml", factory = YmlPropertySourceFactory.class)
|
||||
public class DubboConfiguration {
|
||||
|
||||
}
|
@@ -1,7 +1,7 @@
|
||||
package org.dromara.common.dubbo.properties;
|
||||
|
||||
import org.dromara.common.dubbo.enumd.RequestLogEnum;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.dubbo.enumd.RequestLogEnum;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
|
||||
|
@@ -1 +1 @@
|
||||
org.dromara.common.dubbo.properties.DubboCustomProperties
|
||||
org.dromara.common.dubbo.config.DubboConfiguration
|
||||
|
@@ -0,0 +1,30 @@
|
||||
# 内置配置 不允许修改 如需修改请在 nacos 上写相同配置覆盖
|
||||
dubbo:
|
||||
application:
|
||||
logger: slf4j
|
||||
# 元数据中心 local 本地 remote 远程 这里使用远程便于其他服务获取
|
||||
metadataType: remote
|
||||
# 可选值 interface、instance、all,默认是 all,即接口级地址、应用级地址都注册
|
||||
register-mode: instance
|
||||
service-discovery:
|
||||
# FORCE_INTERFACE,只消费接口级地址,如无地址则报错,单订阅 2.x 地址
|
||||
# APPLICATION_FIRST,智能决策接口级/应用级地址,双订阅
|
||||
# FORCE_APPLICATION,只消费应用级地址,如无地址则报错,单订阅 3.x 地址
|
||||
migration: FORCE_APPLICATION
|
||||
# 注册中心配置
|
||||
registry:
|
||||
address: nacos://${spring.cloud.nacos.server-addr}
|
||||
group: DUBBO_GROUP
|
||||
parameters:
|
||||
namespace: ${spring.profiles.active}
|
||||
# 消费者相关配置
|
||||
consumer:
|
||||
# 结果缓存(LRU算法)
|
||||
# 会有数据不一致问题 建议在注解局部开启
|
||||
cache: false
|
||||
# 支持校验注解
|
||||
validation: jvalidationNew
|
||||
# 调用重试 不包括第一次 0为不需要重试
|
||||
retries: 0
|
||||
# 初始化检查
|
||||
check: false
|
Reference in New Issue
Block a user