mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-18 09:35:29 +08:00
支持dubbo
This commit is contained in:
parent
19530c1856
commit
af1c70ed6b
@ -20,37 +20,28 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
<!-- Nacos注册中心 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<!--nacos配置中心 排除了不是他的问题-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
<!-- 服务发现:OpenFeign服务调用 -->
|
||||
|
||||
<!-- Apache Dubbo 配置 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<!-- 没有loadbalancer调用会报错 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-nacos-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba.nacos</groupId>
|
||||
<artifactId>logback-adapter</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<!-- Spring Cloud Starter 排除了不是他的问题 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
||||
</dependency>
|
||||
<!-- 后续上面的pom换位置-->
|
||||
<!-- 后续上面的pom换位置-->
|
||||
|
||||
|
||||
<!-- Mysql驱动包 -->
|
||||
@ -123,16 +114,16 @@
|
||||
</dependency>
|
||||
|
||||
<!-- skywalking 整合 logback -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.apache.skywalking</groupId>-->
|
||||
<!-- <artifactId>apm-toolkit-logback-1.x</artifactId>-->
|
||||
<!-- <version>${与你的agent探针版本保持一致}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.apache.skywalking</groupId>-->
|
||||
<!-- <artifactId>apm-toolkit-trace</artifactId>-->
|
||||
<!-- <version>${与你的agent探针版本保持一致}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.apache.skywalking</groupId>-->
|
||||
<!-- <artifactId>apm-toolkit-logback-1.x</artifactId>-->
|
||||
<!-- <version>${与你的agent探针版本保持一致}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.apache.skywalking</groupId>-->
|
||||
<!-- <artifactId>apm-toolkit-trace</artifactId>-->
|
||||
<!-- <version>${与你的agent探针版本保持一致}</version>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
package org.dromara;
|
||||
|
||||
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
|
||||
/**
|
||||
* 启动程序
|
||||
@ -11,7 +11,7 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
* @author Lion Li
|
||||
*/
|
||||
|
||||
@EnableDiscoveryClient
|
||||
@EnableDubbo
|
||||
@SpringBootApplication
|
||||
public class DromaraApplication {
|
||||
|
||||
|
||||
@ -1,3 +1,49 @@
|
||||
spring:
|
||||
profiles:
|
||||
active: dev
|
||||
application:
|
||||
name: saas-tenant-admin
|
||||
config:
|
||||
import:
|
||||
#使用nacos配置 demo-boot-v3对应上面的data-id
|
||||
nacos:application
|
||||
cloud:
|
||||
nacos:
|
||||
config:
|
||||
file-extension: yaml
|
||||
group: DEFAULT_GROUP
|
||||
refresh-enabled: true
|
||||
server-addr: http://localhost:8848
|
||||
namespace: c5c00044-93e6-4e66-8060-3f39aa7ab82b
|
||||
|
||||
# dubbo
|
||||
dubbo:
|
||||
config:
|
||||
protocol:
|
||||
name: tri
|
||||
port: 20881
|
||||
application:
|
||||
qos-enable: false
|
||||
logger: slf4j
|
||||
name: ${spring.application.name}
|
||||
# 注册中心配置
|
||||
registry:
|
||||
address: nacos://127.0.0.1:8848
|
||||
group: DUBBO_GROUP
|
||||
parameters:
|
||||
namespace: c5c00044-93e6-4e66-8060-3f39aa7ab82b
|
||||
consumer:
|
||||
# 结果缓存(LRU算法)
|
||||
# 会有数据不一致问题 建议在注解局部开启
|
||||
cache: false
|
||||
# 支持校验注解
|
||||
validation: jvalidationNew
|
||||
# 调用重试 不包括第一次 0为不需要重试
|
||||
retries: 0
|
||||
# 初始化检查
|
||||
check: false
|
||||
|
||||
|
||||
captcha:
|
||||
enable: true
|
||||
# 页面 <参数设置> 可开启关闭 验证码校验
|
||||
@ -48,40 +94,6 @@ user:
|
||||
# 密码锁定时间(默认10分钟)
|
||||
lockTime: 10
|
||||
|
||||
# Spring配置
|
||||
spring:
|
||||
threads:
|
||||
# 开启虚拟线程 仅jdk21可用
|
||||
virtual:
|
||||
enabled: false
|
||||
# 资源信息
|
||||
messages:
|
||||
# 国际化资源文件路径
|
||||
basename: i18n/messages
|
||||
# 文件上传
|
||||
servlet:
|
||||
multipart:
|
||||
# 单个文件大小
|
||||
max-file-size: 10MB
|
||||
# 设置总上传的文件大小
|
||||
max-request-size: 20MB
|
||||
mvc:
|
||||
# 设置静态资源路径 防止所有请求都去查静态资源
|
||||
static-path-pattern: /static/**
|
||||
format:
|
||||
date-time: yyyy-MM-dd HH:mm:ss
|
||||
jackson:
|
||||
# 日期格式化
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
serialization:
|
||||
# 格式化输出
|
||||
indent_output: false
|
||||
# 忽略无法转换的对象
|
||||
fail_on_empty_beans: false
|
||||
deserialization:
|
||||
# 允许对象忽略json中不存在的属性
|
||||
fail_on_unknown_properties: false
|
||||
|
||||
# Sa-Token配置
|
||||
sa-token:
|
||||
# token名称 (同时也是cookie名称)
|
||||
@ -235,6 +247,42 @@ thread-pool:
|
||||
# 线程池维护线程所允许的空闲时间
|
||||
keepAliveSeconds: 300
|
||||
|
||||
|
||||
--- # Spring配置
|
||||
spring:
|
||||
threads:
|
||||
# 开启虚拟线程 仅jdk21可用
|
||||
virtual:
|
||||
enabled: false
|
||||
# 资源信息
|
||||
messages:
|
||||
# 国际化资源文件路径
|
||||
basename: i18n/messages
|
||||
# 文件上传
|
||||
servlet:
|
||||
multipart:
|
||||
# 单个文件大小
|
||||
max-file-size: 10MB
|
||||
# 设置总上传的文件大小
|
||||
max-request-size: 20MB
|
||||
mvc:
|
||||
# 设置静态资源路径 防止所有请求都去查静态资源
|
||||
static-path-pattern: /static/**
|
||||
format:
|
||||
date-time: yyyy-MM-dd HH:mm:ss
|
||||
jackson:
|
||||
# 日期格式化
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
serialization:
|
||||
# 格式化输出
|
||||
indent_output: false
|
||||
# 忽略无法转换的对象
|
||||
fail_on_empty_beans: false
|
||||
deserialization:
|
||||
# 允许对象忽略json中不存在的属性
|
||||
fail_on_unknown_properties: false
|
||||
|
||||
|
||||
--- # 分布式锁 lock4j 全局配置
|
||||
lock4j:
|
||||
# 获取分布式锁超时时间,默认为 3000 毫秒
|
||||
|
||||
@ -1,52 +0,0 @@
|
||||
spring:
|
||||
profiles:
|
||||
active: dev
|
||||
application:
|
||||
name: saas-tenant-admin
|
||||
config:
|
||||
import:
|
||||
#使用nacos配置 demo-boot-v3对应上面的data-id
|
||||
nacos:demo-boot-v3
|
||||
cloud:
|
||||
nacos:
|
||||
config:
|
||||
file-extension: yaml
|
||||
group: DEFAULT_GROUP
|
||||
refresh-enabled: true
|
||||
|
||||
---
|
||||
# local
|
||||
spring:
|
||||
config:
|
||||
activate:
|
||||
on-profile: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: http://localhost:8848
|
||||
namespace: c5c00044-93e6-4e66-8060-3f39aa7ab82b
|
||||
group: dev
|
||||
config:
|
||||
server-addr: http://localhost:8848
|
||||
file-extension: yaml
|
||||
namespace: c5c00044-93e6-4e66-8060-3f39aa7ab82b
|
||||
group: dev
|
||||
|
||||
---
|
||||
# prod
|
||||
spring:
|
||||
config:
|
||||
activate:
|
||||
on-profile: prod
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: http://nacos:8848
|
||||
namespace: rrrrrrrrr
|
||||
group: prod
|
||||
config:
|
||||
server-addr: http://nacos:8848
|
||||
file-extension: yaml
|
||||
namespace: rrrrrrrrr
|
||||
group: prod
|
||||
|
||||
Loading…
Reference in New Issue
Block a user