Class IntegrationProperties
java.lang.Object
org.springframework.integration.context.IntegrationProperties
public final class IntegrationProperties extends Object
Utility class to encapsulate infrastructure Integration properties constants and their default values.
The default values can be overridden by the
META-INF/spring.integration.properties
with this entries
(includes their default values):
-
spring.integration.channels.autoCreate=true
-
spring.integration.channels.maxUnicastSubscribers=0x7fffffff
-
spring.integration.channels.maxBroadcastSubscribers=0x7fffffff
-
spring.integration.taskScheduler.poolSize=10
-
spring.integration.messagingTemplate.throwExceptionOnLateReply=false
-
spring.integration.readOnly.headers=
-
spring.integration.endpoints.noAutoStartup=
-
spring.integration.channels.error.requireSubscribers=true
-
spring.integration.channels.error.ignoreFailures=true
- Since:
- 3.0
- Author:
- Artem Bilan
-
Field Summary
Fields Modifier and Type Field Description static String
CHANNELS_AUTOCREATE
Specifies whether to allow create automaticallyDirectChannel
beans for non-declared channels or not.static String
CHANNELS_MAX_BROADCAST_SUBSCRIBERS
Specifies the value forAbstractDispatcher.maxSubscribers
in case of point-to-point channels (e.g.static String
CHANNELS_MAX_UNICAST_SUBSCRIBERS
Specifies the value forAbstractDispatcher.maxSubscribers
in case of point-to-point channels (e.g.static String
ENDPOINTS_NO_AUTO_STARTUP
Specifies the value ofAbstractEndpoint.autoStartup
.static String
ERROR_CHANNEL_IGNORE_FAILURES
Specifies the value forPublishSubscribeChannel.ignoreFailures
on a global defaultIntegrationContextUtils.ERROR_CHANNEL_BEAN_NAME
.static String
ERROR_CHANNEL_REQUIRE_SUBSCRIBERS
Specifies the value forPublishSubscribeChannel.requireSubscribers
on a global defaultIntegrationContextUtils.ERROR_CHANNEL_BEAN_NAME
.static String
INTEGRATION_PROPERTIES_PREFIX
static String
READ_ONLY_HEADERS
Specifies the value ofDefaultMessageBuilderFactory.readOnlyHeaders
.static String
TASK_SCHEDULER_POOL_SIZE
Specifies the value ofThreadPoolTaskScheduler.poolSize
for thetaskScheduler
bean initialized by the Integration infrastructure.static String
THROW_EXCEPTION_ON_LATE_REPLY
Specifies the value ofGenericMessagingTemplate.throwExceptionOnLateReply
. -
Constructor Summary
Constructors Constructor Description IntegrationProperties()
-
Method Summary
Modifier and Type Method Description static Properties
defaults()
int
getChannelsMaxBroadcastSubscribers()
Return the value ofCHANNELS_MAX_BROADCAST_SUBSCRIBERS
option.int
getChannelsMaxUnicastSubscribers()
Return the value ofCHANNELS_MAX_UNICAST_SUBSCRIBERS
option.static String
getExpressionFor(String key)
Build the bean property definition expression to resolve the value from Integration properties within the bean building phase.String[]
getNoAutoStartupEndpoints()
Return the value ofENDPOINTS_NO_AUTO_STARTUP
option.String[]
getReadOnlyHeaders()
Return the value ofREAD_ONLY_HEADERS
option.int
getTaskSchedulerPoolSize()
Return the value ofTASK_SCHEDULER_POOL_SIZE
option.boolean
isChannelsAutoCreate()
Return the value ofCHANNELS_AUTOCREATE
option.boolean
isErrorChannelIgnoreFailures()
Return the value ofERROR_CHANNEL_IGNORE_FAILURES
option.boolean
isErrorChannelRequireSubscribers()
Return the value ofERROR_CHANNEL_REQUIRE_SUBSCRIBERS
option.boolean
isMessagingTemplateThrowExceptionOnLateReply()
Return the value ofTHROW_EXCEPTION_ON_LATE_REPLY
option.static IntegrationProperties
parse(Properties properties)
Parse a providedProperties
and build anIntegrationProperties
instance.void
setChannelsAutoCreate(boolean channelsAutoCreate)
Configure a value forCHANNELS_AUTOCREATE
option.void
setChannelsMaxBroadcastSubscribers(int channelsMaxBroadcastSubscribers)
Configure a value forCHANNELS_MAX_BROADCAST_SUBSCRIBERS
option.void
setChannelsMaxUnicastSubscribers(int channelsMaxUnicastSubscribers)
Configure a value forCHANNELS_MAX_UNICAST_SUBSCRIBERS
option.void
setErrorChannelIgnoreFailures(boolean errorChannelIgnoreFailures)
Configure a value forERROR_CHANNEL_IGNORE_FAILURES
option.void
setErrorChannelRequireSubscribers(boolean errorChannelRequireSubscribers)
Configure a value forERROR_CHANNEL_REQUIRE_SUBSCRIBERS
option.void
setMessagingTemplateThrowExceptionOnLateReply(boolean messagingTemplateThrowExceptionOnLateReply)
Configure a value forTHROW_EXCEPTION_ON_LATE_REPLY
option.void
setNoAutoStartupEndpoints(String... noAutoStartupEndpoints)
Configure a value forENDPOINTS_NO_AUTO_STARTUP
option.void
setReadOnlyHeaders(String... readOnlyHeaders)
Configure a value forREAD_ONLY_HEADERS
option.void
setTaskSchedulerPoolSize(int taskSchedulerPoolSize)
Configure a value forTASK_SCHEDULER_POOL_SIZE
option.Properties
toProperties()
Represent the current instance as aProperties
.
-
Field Details
-
INTEGRATION_PROPERTIES_PREFIX
- See Also:
- Constant Field Values
-
CHANNELS_AUTOCREATE
Specifies whether to allow create automaticallyDirectChannel
beans for non-declared channels or not.- See Also:
- Constant Field Values
-
CHANNELS_MAX_UNICAST_SUBSCRIBERS
Specifies the value forAbstractDispatcher.maxSubscribers
in case of point-to-point channels (e.g.ExecutorChannel
), if the attributemax-subscribers
isn't configured on the channel component.- See Also:
- Constant Field Values
-
CHANNELS_MAX_BROADCAST_SUBSCRIBERS
Specifies the value forAbstractDispatcher.maxSubscribers
in case of point-to-point channels (e.g.PublishSubscribeChannel
), if the attributemax-subscribers
isn't configured on the channel component.- See Also:
- Constant Field Values
-
ERROR_CHANNEL_REQUIRE_SUBSCRIBERS
Specifies the value forPublishSubscribeChannel.requireSubscribers
on a global defaultIntegrationContextUtils.ERROR_CHANNEL_BEAN_NAME
.- See Also:
- Constant Field Values
-
ERROR_CHANNEL_IGNORE_FAILURES
Specifies the value forPublishSubscribeChannel.ignoreFailures
on a global defaultIntegrationContextUtils.ERROR_CHANNEL_BEAN_NAME
.- See Also:
- Constant Field Values
-
TASK_SCHEDULER_POOL_SIZE
Specifies the value ofThreadPoolTaskScheduler.poolSize
for thetaskScheduler
bean initialized by the Integration infrastructure.- See Also:
- Constant Field Values
-
THROW_EXCEPTION_ON_LATE_REPLY
Specifies the value ofGenericMessagingTemplate.throwExceptionOnLateReply
.- See Also:
- Constant Field Values
-
READ_ONLY_HEADERS
Specifies the value ofDefaultMessageBuilderFactory.readOnlyHeaders
.- See Also:
- Constant Field Values
-
ENDPOINTS_NO_AUTO_STARTUP
Specifies the value ofAbstractEndpoint.autoStartup
.- See Also:
- Constant Field Values
-
-
Constructor Details
-
IntegrationProperties
public IntegrationProperties()
-
-
Method Details
-
setChannelsAutoCreate
public void setChannelsAutoCreate(boolean channelsAutoCreate)Configure a value forCHANNELS_AUTOCREATE
option.- Parameters:
channelsAutoCreate
- the value forCHANNELS_AUTOCREATE
option.
-
isChannelsAutoCreate
public boolean isChannelsAutoCreate()Return the value ofCHANNELS_AUTOCREATE
option.- Returns:
- the value of
CHANNELS_AUTOCREATE
option.
-
setChannelsMaxUnicastSubscribers
public void setChannelsMaxUnicastSubscribers(int channelsMaxUnicastSubscribers)Configure a value forCHANNELS_MAX_UNICAST_SUBSCRIBERS
option.- Parameters:
channelsMaxUnicastSubscribers
- the value forCHANNELS_MAX_UNICAST_SUBSCRIBERS
option.
-
getChannelsMaxUnicastSubscribers
public int getChannelsMaxUnicastSubscribers()Return the value ofCHANNELS_MAX_UNICAST_SUBSCRIBERS
option.- Returns:
- the value of
CHANNELS_MAX_UNICAST_SUBSCRIBERS
option.
-
setChannelsMaxBroadcastSubscribers
public void setChannelsMaxBroadcastSubscribers(int channelsMaxBroadcastSubscribers)Configure a value forCHANNELS_MAX_BROADCAST_SUBSCRIBERS
option.- Parameters:
channelsMaxBroadcastSubscribers
- the value forCHANNELS_MAX_BROADCAST_SUBSCRIBERS
option.
-
getChannelsMaxBroadcastSubscribers
public int getChannelsMaxBroadcastSubscribers()Return the value ofCHANNELS_MAX_BROADCAST_SUBSCRIBERS
option.- Returns:
- the value of
CHANNELS_MAX_BROADCAST_SUBSCRIBERS
option.
-
setErrorChannelRequireSubscribers
public void setErrorChannelRequireSubscribers(boolean errorChannelRequireSubscribers)Configure a value forERROR_CHANNEL_REQUIRE_SUBSCRIBERS
option.- Parameters:
errorChannelRequireSubscribers
- the value forERROR_CHANNEL_REQUIRE_SUBSCRIBERS
option.
-
isErrorChannelRequireSubscribers
public boolean isErrorChannelRequireSubscribers()Return the value ofERROR_CHANNEL_REQUIRE_SUBSCRIBERS
option.- Returns:
- the value of
ERROR_CHANNEL_REQUIRE_SUBSCRIBERS
option.
-
setErrorChannelIgnoreFailures
public void setErrorChannelIgnoreFailures(boolean errorChannelIgnoreFailures)Configure a value forERROR_CHANNEL_IGNORE_FAILURES
option.- Parameters:
errorChannelIgnoreFailures
- the value forERROR_CHANNEL_IGNORE_FAILURES
option.
-
isErrorChannelIgnoreFailures
public boolean isErrorChannelIgnoreFailures()Return the value ofERROR_CHANNEL_IGNORE_FAILURES
option.- Returns:
- the value of
ERROR_CHANNEL_IGNORE_FAILURES
option.
-
setTaskSchedulerPoolSize
public void setTaskSchedulerPoolSize(int taskSchedulerPoolSize)Configure a value forTASK_SCHEDULER_POOL_SIZE
option.- Parameters:
taskSchedulerPoolSize
- the value forTASK_SCHEDULER_POOL_SIZE
option.
-
getTaskSchedulerPoolSize
public int getTaskSchedulerPoolSize()Return the value ofTASK_SCHEDULER_POOL_SIZE
option.- Returns:
- the value of
TASK_SCHEDULER_POOL_SIZE
option.
-
setMessagingTemplateThrowExceptionOnLateReply
public void setMessagingTemplateThrowExceptionOnLateReply(boolean messagingTemplateThrowExceptionOnLateReply)Configure a value forTHROW_EXCEPTION_ON_LATE_REPLY
option.- Parameters:
messagingTemplateThrowExceptionOnLateReply
- the value forTHROW_EXCEPTION_ON_LATE_REPLY
option.
-
isMessagingTemplateThrowExceptionOnLateReply
public boolean isMessagingTemplateThrowExceptionOnLateReply()Return the value ofTHROW_EXCEPTION_ON_LATE_REPLY
option.- Returns:
- the value of
THROW_EXCEPTION_ON_LATE_REPLY
option.
-
setReadOnlyHeaders
Configure a value forREAD_ONLY_HEADERS
option.- Parameters:
readOnlyHeaders
- the value forREAD_ONLY_HEADERS
option.
-
getReadOnlyHeaders
Return the value ofREAD_ONLY_HEADERS
option.- Returns:
- the value of
READ_ONLY_HEADERS
option.
-
setNoAutoStartupEndpoints
Configure a value forENDPOINTS_NO_AUTO_STARTUP
option.- Parameters:
noAutoStartupEndpoints
- the value forENDPOINTS_NO_AUTO_STARTUP
option.
-
getNoAutoStartupEndpoints
Return the value ofENDPOINTS_NO_AUTO_STARTUP
option.- Returns:
- the value of
ENDPOINTS_NO_AUTO_STARTUP
option.
-
toProperties
Represent the current instance as aProperties
.- Returns:
- the
Properties
representation. - Since:
- 5.5
-
parse
Parse a providedProperties
and build anIntegrationProperties
instance.- Parameters:
properties
- theProperties
to parse entries forIntegrationProperties
.- Returns:
IntegrationProperties
based on the providedProperties
.- Since:
- 5.5
-
defaults
- Returns:
Properties
with default values for Integration properties.
-
getExpressionFor
Build the bean property definition expression to resolve the value from Integration properties within the bean building phase.- Parameters:
key
- the Integration property key.- Returns:
- the bean property definition expression.
- Throws:
IllegalArgumentException
- if providedkey
isn't an Integration property.
-