|
该版本仍在开发中,尚未被视为稳定。对于最新的稳定版本,请使用 Spring Integration 7.0.0! |
全局属性
某些全局框架属性可以通过在类路径上提供属性文件来覆盖。
默认属性可以找到org.springframework.integration.context.IntegrationProperties类。 以下列表显示了默认值:
spring.integration.channels.autoCreate=true (1)
spring.integration.channels.maxUnicastSubscribers=0x7fffffff (2)
spring.integration.channels.maxBroadcastSubscribers=0x7fffffff (3)
spring.integration.taskScheduler.poolSize=10 (4)
spring.integration.messagingTemplate.throwExceptionOnLateReply=false (5)
spring.integration.readOnly.headers= (6)
spring.integration.endpoints.noAutoStartup= (7)
spring.integration.channels.error.requireSubscribers=true (8)
spring.integration.channels.error.ignoreFailures=true (9)
spring.integration.endpoints.defaultTimeout=30000 (10)
| 1 | 当属实时,输入通道实例自动声明为直达频道当应用上下文中未明确找到的实例。 |
| 2 | 设置默认允许的订阅人数,例如:直达频道. 它可以用来避免无意中订阅多个终端到同一频道。你可以通过设置最大订阅者属性。 |
| 3 | 该属性提供了例如,允许的默认订阅人数发布订阅频道. 它可以用来避免无意中订阅超过预期数量的同一频道端点数量。你可以通过设置最大订阅者属性。 |
| 4 | 默认情况下可用的线程数量任务调度器豆。 参见配置任务调度器。 |
| 5 | 什么时候true当网关不期待回复(因为发送线程超时或已收到回复)时,抵达网关回复通道的消息会抛出异常。 |
| 6 | 一个逗号分隔的消息头名列表,不应被填充于消息在一个头部复制作中。该列表被默认信息建设工厂Beans并被繁殖到集成消息头访问器实例(参见消息头访问器应用程序接口)用于构建消息,通过以下方式消息构建器(参见这消息构建器辅助类). 默认情况下,只有MessageHeaders.ID和消息头部.时间戳在消息构建过程中不会被复制。自4.3.2版本起, |
| 7 | 逗号分隔的列表摘要终点Bean 给图案命名(xxx*,xxx,*xxx或xxx*yyy)在应用启动时不应自动启动。你可以通过控制总线(参见控制总线),根据它们与SmartLifecycleRoleController(参见端点角色),或由生命周期豆子注入。你可以通过指定自动启动XML 注释或自动启动注释属性或调用AbstractEndpoint.setAutoStartup()在豆子定义中。自4.3.12版本起。 |
| 8 | 一个布尔标志来表示默认的全局errorChannel必须配置为要求订阅者选择。 自5.4.3版本起。更多信息请参见错误处理。 |
| 9 | 一个布尔标志来表示默认的全局errorChannel必须忽略调度错误,并将消息传递给下一个处理器。自5.5版本起。 |
| 10 | 端点请求和回复超时的默认毫秒数。默认值为30秒以避免无限阻塞。可配置为负值以恢复端点的无限阻断行为。自6.2版本起。 |
这些属性可以通过添加 a 来覆盖/META-INF/spring.integration.properties文件到类通路或IntegrationContextUtils.INTEGRATION_GLOBAL_PROPERTIES_BEAN_NAME豆子org.springframework.integration.context.IntegrationProperties实例。 你不必提供所有属性——只需提供你想要覆盖的那些。
从5.1版本开始,所有合并后的全局属性在应用上下文启动后都会在日志中打印出来,当时调试逻辑电平被打开用于org.springframework.integration类别。 输出如下:
Spring Integration global properties:
spring.integration.endpoints.noAutoStartup=fooService*
spring.integration.taskScheduler.poolSize=20
spring.integration.channels.maxUnicastSubscribers=0x7fffffff
spring.integration.channels.autoCreate=true
spring.integration.channels.maxBroadcastSubscribers=0x7fffffff
spring.integration.readOnly.headers=
spring.integration.messagingTemplate.throwExceptionOnLateReply=true
spring.integration.endpoints.defaultTimeout=30000