package com.qianwen.smartman.modules.notify.message.rocket;
|
|
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
import com.qianwen.core.notify.NotifierProvidersMapManager;
|
import com.qianwen.core.notify.NotifyResultProducer;
|
import com.qianwen.core.notify.executor.NotifyQueueExecutorProvider;
|
import com.qianwen.core.notify.executor.NotifyTaskExecutorProvider;
|
import com.qianwen.core.notify.notifier.NotifierManager;
|
import com.qianwen.core.notify.notifier.NotifyConfigManager;
|
import com.qianwen.smartman.modules.notify.manager.DefaultNotifierManager;
|
import com.qianwen.smartman.modules.notify.message.rocket.consumer.NotifyHistoryConsumer;
|
import com.qianwen.smartman.modules.notify.message.rocket.consumer.NotifyQueueExecuteConsumer;
|
import com.qianwen.smartman.modules.notify.message.rocket.consumer.NotifyTaskExecuteConsumer;
|
import com.qianwen.smartman.modules.notify.message.rocket.producer.RocketNotifyQueueProducer;
|
import com.qianwen.smartman.modules.notify.message.rocket.producer.RocketNotifyResultProducer;
|
import com.qianwen.smartman.modules.notify.service.INotifyHistoryService;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Configuration;
|
|
@ConditionalOnClass({RocketMQTemplate.class})
|
@ConditionalOnProperty(prefix = "blade.task", name = {"distributor"}, havingValue = "rocket", matchIfMissing = true)
|
@Configuration(proxyBeanMethods = false)
|
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/notify/message/rocket/RocketTaskConfiguration.class */
|
public class RocketTaskConfiguration {
|
@ConditionalOnBean({NotifyTaskExecutorProvider.class})
|
@Bean
|
public NotifyTaskExecuteConsumer notifyTaskExecuteConsumer(NotifyTaskExecutorProvider notifyTaskExecutorProvider) {
|
return new NotifyTaskExecuteConsumer(notifyTaskExecutorProvider);
|
}
|
|
@ConditionalOnBean({NotifyQueueExecutorProvider.class})
|
@Bean
|
public NotifyQueueExecuteConsumer notifyQueueExecuteConsumer(NotifyQueueExecutorProvider notifyQueueExecutorProvider) {
|
return new NotifyQueueExecuteConsumer(notifyQueueExecutorProvider);
|
}
|
|
@ConditionalOnBean({INotifyHistoryService.class})
|
@Bean
|
public NotifyHistoryConsumer notifyHistoryConsumer(INotifyHistoryService notifyHistoryService) {
|
return new NotifyHistoryConsumer(notifyHistoryService);
|
}
|
|
@Bean
|
public RocketNotifyQueueProducer notifyQueueProducer(RocketMQTemplate rocketMQTemplate) {
|
return new RocketNotifyQueueProducer(rocketMQTemplate);
|
}
|
|
@Bean
|
public RocketNotifyResultProducer notifyResultProducer(RocketMQTemplate rocketMQTemplate) {
|
return new RocketNotifyResultProducer(rocketMQTemplate);
|
}
|
|
@Bean
|
public NotifierManager defaultNotifierManager(NotifyResultProducer notifyResultProducer, NotifyConfigManager configManager, NotifierProvidersMapManager notifierProvidersMapManager) {
|
return new DefaultNotifierManager(notifyResultProducer, notifierProvidersMapManager, configManager);
|
}
|
}
|