多余加载
This commit is contained in:
@@ -1,61 +0,0 @@
|
|||||||
package com.czg.config;
|
|
||||||
|
|
||||||
import org.apache.dubbo.config.ApplicationConfig;
|
|
||||||
import org.apache.dubbo.config.ProtocolConfig;
|
|
||||||
import org.apache.dubbo.config.RegistryConfig;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author GYJoker
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
public class CzgDubboBean {
|
|
||||||
|
|
||||||
private ApplicationConfig applicationConfig;
|
|
||||||
private ProtocolConfig protocolConfig;
|
|
||||||
|
|
||||||
@Value("${dubbo.application.name}")
|
|
||||||
private String applicationName;
|
|
||||||
|
|
||||||
@Value("${dubbo.application.qos-port}")
|
|
||||||
private Integer qosPort;
|
|
||||||
|
|
||||||
@Value("${dubbo.application.qos-enable}")
|
|
||||||
private Boolean qosEnable;
|
|
||||||
|
|
||||||
@Value("${dubbo.registry.address}")
|
|
||||||
private String registryAddress;
|
|
||||||
|
|
||||||
@Value("${dubbo.registry.group}")
|
|
||||||
private String registryGroup;
|
|
||||||
|
|
||||||
@Value("${dubbo.protocol.port}")
|
|
||||||
private Integer port;
|
|
||||||
|
|
||||||
@Value("${dubbo.protocol.threads}")
|
|
||||||
private Integer threads;
|
|
||||||
|
|
||||||
public CzgDubboBean() {
|
|
||||||
applicationConfig = new ApplicationConfig();
|
|
||||||
applicationConfig.setName(applicationName);
|
|
||||||
applicationConfig.setQosPort(qosPort);
|
|
||||||
applicationConfig.setQosEnable(qosEnable);
|
|
||||||
|
|
||||||
RegistryConfig registryConfig = new RegistryConfig();
|
|
||||||
registryConfig.setAddress(registryAddress);
|
|
||||||
registryConfig.setGroup(registryGroup);
|
|
||||||
|
|
||||||
protocolConfig = new ProtocolConfig();
|
|
||||||
protocolConfig.setPort(port);
|
|
||||||
protocolConfig.setThreads(threads);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ApplicationConfig getApplicationConfig() {
|
|
||||||
return applicationConfig;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ProtocolConfig getProtocolConfig() {
|
|
||||||
return protocolConfig;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
package com.czg.config;
|
|
||||||
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.context.annotation.DependsOn;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author GYJoker
|
|
||||||
*/
|
|
||||||
@Configuration
|
|
||||||
@DependsOn("nacosConfigProperties") // 这里假设 Nacos 的配置属性 Bean 名为 nacosConfigProperties
|
|
||||||
public class DubboConfig {
|
|
||||||
// 这里可以添加 Dubbo 相关的配置 Bean
|
|
||||||
@Bean
|
|
||||||
public CzgDubboBean czgDubboBean() {
|
|
||||||
return new CzgDubboBean();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -151,17 +151,6 @@
|
|||||||
<artifactId>dubbo-spring-boot-starter</artifactId>
|
<artifactId>dubbo-spring-boot-starter</artifactId>
|
||||||
<version>${dubbo-spring.version}</version>
|
<version>${dubbo-spring.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- Nacos Discovery for Dubbo -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.dubbo</groupId>
|
|
||||||
<artifactId>dubbo-registry-nacos</artifactId>
|
|
||||||
<version>${dubbo-registry-nacos.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.dubbo</groupId>
|
|
||||||
<artifactId>dubbo</artifactId>
|
|
||||||
<version>${dubbo.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- https://mvnrepository.com/artifact/io.seata/seata-spring-boot-starter -->
|
<!-- https://mvnrepository.com/artifact/io.seata/seata-spring-boot-starter -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.seata</groupId>
|
<groupId>io.seata</groupId>
|
||||||
@@ -191,12 +180,6 @@
|
|||||||
<version>${fastjson2.version}</version>
|
<version>${fastjson2.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Spring Boot与nacos整合的核心依赖 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
|
||||||
<version>${nacos-discovery.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- 配置管理依赖,如果你需要配置管理功能 -->
|
<!-- 配置管理依赖,如果你需要配置管理功能 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -71,11 +71,6 @@
|
|||||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Spring Boot与nacos整合的核心依赖 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- 配置管理依赖,如果你需要配置管理功能 -->
|
<!-- 配置管理依赖,如果你需要配置管理功能 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -103,15 +98,5 @@
|
|||||||
<artifactId>dubbo-spring-boot-starter</artifactId>
|
<artifactId>dubbo-spring-boot-starter</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.dubbo</groupId>
|
|
||||||
<artifactId>dubbo-registry-nacos</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.dubbo</groupId>
|
|
||||||
<artifactId>dubbo</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
Reference in New Issue
Block a user