org.zodiac.autoconfigure.application.DefaultReactiveApplicatuonBootstrapAutoConfiguration Maven / Gradle / Ivy
package org.zodiac.autoconfigure.application;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.zodiac.core.logging.trace.ReactiveTraceLoggingMDCFilter;
@SpringBootConfiguration
@ConditionalOnWebApplication(type = Type.REACTIVE)
@AutoConfigureAfter(value = {DefaultApplicatuonBootstrapAutoConfiguration.class})
public class DefaultReactiveApplicatuonBootstrapAutoConfiguration {
private final ApplicationContext applicationContext;
public DefaultReactiveApplicatuonBootstrapAutoConfiguration(ApplicationContext applicationContext) {
this.applicationContext = applicationContext;
}
@Bean
@ConditionalOnMissingBean(value = {ReactiveTraceLoggingMDCFilter.class})
protected ReactiveTraceLoggingMDCFilter defaultTraceLoggingMDCFilter() {
return new ReactiveTraceLoggingMDCFilter(applicationContext) {};
}
}