fix(tenant): 按需注册多租户 MQ 配置
将 Redis、RabbitMQ、RocketMQ 的多租户 Bean 拆到独立条件配置, 避免未引入 yudao-spring-boot-starter-mq 的模块启动时因解析 YudaoTenantAutoConfiguration 方法签名触发 NoClassDefFoundError。 Closes https://gitee.com/zhijiantianya/yudao-cloud/issues/IJTOF4master-jdk17
parent
bf35900a25
commit
b7fbfc4a19
|
|
@ -156,21 +156,37 @@ public class YudaoTenantAutoConfiguration {
|
|||
|
||||
// ========== MQ ==========
|
||||
|
||||
@Bean
|
||||
public TenantRedisMessageInterceptor tenantRedisMessageInterceptor() {
|
||||
return new TenantRedisMessageInterceptor();
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnClass(name = "cn.iocoder.yudao.framework.mq.redis.core.interceptor.RedisMessageInterceptor")
|
||||
public static class TenantRedisMQConfiguration {
|
||||
|
||||
@Bean
|
||||
public TenantRedisMessageInterceptor tenantRedisMessageInterceptor() {
|
||||
return new TenantRedisMessageInterceptor();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnClass(name = "org.springframework.amqp.rabbit.core.RabbitTemplate")
|
||||
public TenantRabbitMQInitializer tenantRabbitMQInitializer() {
|
||||
return new TenantRabbitMQInitializer();
|
||||
public static class TenantRabbitMQConfiguration {
|
||||
|
||||
@Bean
|
||||
public TenantRabbitMQInitializer tenantRabbitMQInitializer() {
|
||||
return new TenantRabbitMQInitializer();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnClass(name = "org.apache.rocketmq.spring.core.RocketMQTemplate")
|
||||
public TenantRocketMQInitializer tenantRocketMQInitializer() {
|
||||
return new TenantRocketMQInitializer();
|
||||
public static class TenantRocketMQConfiguration {
|
||||
|
||||
@Bean
|
||||
public TenantRocketMQInitializer tenantRocketMQInitializer() {
|
||||
return new TenantRocketMQInitializer();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// ========== Redis ==========
|
||||
|
|
|
|||
Loading…
Reference in New Issue