All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.icthh.xm.commons.scheduler.config.SchedulerConfiguration Maven / Gradle / Ivy

There is a newer version: 4.0.17
Show newest version
package com.icthh.xm.commons.scheduler.config;

import com.icthh.xm.commons.config.client.config.XmConfigProperties;
import com.icthh.xm.commons.scheduler.adapter.DynamicTopicConsumerConfiguration;
import com.icthh.xm.commons.scheduler.adapter.SchedulerChannelManager;
import com.icthh.xm.commons.scheduler.service.SchedulerEventService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConditionalOnProperty("application.scheduler-enabled")
public class SchedulerConfiguration {

    @Bean
    public DynamicTopicConsumerConfiguration dynamicTopicConsumerConfiguration(SchedulerEventService schedulerEventService,
                                                                               ApplicationEventPublisher applicationEventPublisher) {
        return new DynamicTopicConsumerConfiguration(schedulerEventService, applicationEventPublisher);
    }

    @Bean
    public SchedulerChannelManager schedulerChannelManager(XmConfigProperties xmConfigProperties,
                                                           DynamicTopicConsumerConfiguration dynamicTopicConsumerConfiguration) {
        return new SchedulerChannelManager(xmConfigProperties, dynamicTopicConsumerConfiguration);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy