Certain global framework properties can be overridden by providing a properties file on the classpath.
The default properties can be found in org.springframework.integration.context.IntegrationProperties
class.
The following listing shows the default values:
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)
-
When true,
input-channel
instances are automatically declared asDirectChannel
instances when not explicitly found in the application context. -
Sets the default number of subscribers allowed on, for example, a
DirectChannel
. It can be used to avoid inadvertently subscribing multiple endpoints to the same channel. You can override it on individual channels by setting themax-subscribers
attribute. -
This property provides the default number of subscribers allowed on, for example, a
PublishSubscribeChannel
. It can be used to avoid inadvertently subscribing more than the expected number of endpoints to the same channel. You can override it on individual channels by setting themax-subscribers
attribute. -
The number of threads available in the default
taskScheduler
bean. See Configuring the Task Scheduler. -
When
true
, messages that arrive at a gateway reply channel throw an exception when the gateway is not expecting a reply (because the sending thread has timed out or already received a reply). -
A comma-separated list of message header names that should not be populated into
Message
instances during a header copying operation. The list is used by theDefaultMessageBuilderFactory
bean and propagated to theIntegrationMessageHeaderAccessor
instances (seeMessageHeaderAccessor
API) used to build messages viaMessageBuilder
(see TheMessageBuilder
Helper Class). By default, onlyMessageHeaders.ID
andMessageHeaders.TIMESTAMP
are not copied during message building. Since version 4.3.2. -
A comma-separated list of
AbstractEndpoint
bean names patterns (xxx*
,xxx
,*xxx
orxxx*yyy
) that should not be started automatically during application startup. You can manually start these endpoints later by their bean name through aControl Bus
(see Control Bus), by their role with theSmartLifecycleRoleController
(see Endpoint Roles), or byLifecycle
bean injection. You can explicitly override the effect of this global property by specifyingauto-startup
XML annotation or theautoStartup
annotation attribute or by callingAbstractEndpoint.setAutoStartup()
in the bean definition. Since version 4.3.12. -
A boolean flag to indicate that default global
errorChannel
must be configured with therequireSubscribers
option. Since version 5.4.3. See Error Handling for more information. -
A boolean flag to indicate that default global
errorChannel
must ignore dispatching errors and pass the message to the next handler. Since version 5.5. -
The default number of milliseconds for request and reply timeouts in endpoints. Default value is 30 seconds to avoid indefinite blocking. Can be configured to a negative value to restore infinite blocking behavior in endpoints. Since version 6.2.
These properties can be overridden by adding a /META-INF/spring.integration.properties
file to the classpath or an IntegrationContextUtils.INTEGRATION_GLOBAL_PROPERTIES_BEAN_NAME
bean for the org.springframework.integration.context.IntegrationProperties
instance.
You need not provide all the properties — only those that you want to override.
Starting with version 5.1, all the merged global properties are printed in the logs after application context startup when a DEBUG
logic level is turned on for the org.springframework.integration
category.
The output looks like this:
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=-1