自动配置
WebFluxSdkAutoConfiguration 自动装配与 ContextWebFluxProperties 配置说明
自动配置
bamboo-webflux 通过 WebFluxSdkAutoConfiguration 自动注册核心组件。
仅在响应式应用环境(REACTIVE)下生效。
WebFluxSdkAutoConfiguration
@AutoConfiguration(before = ErrorWebFluxAutoConfiguration.class)
@EnableAspectJAutoProxy
@EnableConfigurationProperties(ContextWebFluxProperties.class)
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.REACTIVE)
public class WebFluxSdkAutoConfiguration {
// ...
}自动注册组件
| Bean | 说明 |
|---|---|
contextFilter | 上下文过滤器(注入 context 与 startTime) |
logAspectHandler | 日志切面 |
debugAspectHandler | 调试切面 |
globalErrorController | 全局错误处理器 |
mybatisPlusConfigHandler | MyBatis-Plus 配置(条件注册) |
mybatisPlusConfigHandler 的注册条件:
@Bean
@ConditionalOnProperty(
prefix = "utility.context.webflux",
name = "gateway-mode",
havingValue = "false",
matchIfMissing = true
)
@ConditionalOnMissingBean
public MybatisPlusConfigHandler mybatisPlusConfigHandler(UtilityBaseProperties properties) {
return new MybatisPlusConfigHandler(properties);
}ContextWebFluxProperties
ContextWebFluxProperties 绑定前缀 utility.context.webflux:
utility:
context:
webflux:
enable-input: true
enable-output: true
gateway-mode: false
exclude-urls:
- /actuator/**
- /health字段
类型