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 StringCHANNELS_AUTOCREATESpecifies whether to allow create automaticallyDirectChannelbeans for non-declared channels or not.static StringCHANNELS_MAX_BROADCAST_SUBSCRIBERSSpecifies the value forAbstractDispatcher.maxSubscribersin case of point-to-point channels (e.g.static StringCHANNELS_MAX_UNICAST_SUBSCRIBERSSpecifies the value forAbstractDispatcher.maxSubscribersin case of point-to-point channels (e.g.static StringENDPOINTS_NO_AUTO_STARTUPSpecifies the value ofAbstractEndpoint.autoStartup.static StringERROR_CHANNEL_IGNORE_FAILURESSpecifies the value forPublishSubscribeChannel.ignoreFailureson a global defaultIntegrationContextUtils.ERROR_CHANNEL_BEAN_NAME.static StringERROR_CHANNEL_REQUIRE_SUBSCRIBERSSpecifies the value forPublishSubscribeChannel.requireSubscriberson a global defaultIntegrationContextUtils.ERROR_CHANNEL_BEAN_NAME.static StringINTEGRATION_PROPERTIES_PREFIXstatic StringREAD_ONLY_HEADERSSpecifies the value ofDefaultMessageBuilderFactory.readOnlyHeaders.static StringTASK_SCHEDULER_POOL_SIZESpecifies the value ofThreadPoolTaskScheduler.poolSizefor thetaskSchedulerbean initialized by the Integration infrastructure.static StringTHROW_EXCEPTION_ON_LATE_REPLYSpecifies the value ofGenericMessagingTemplate.throwExceptionOnLateReply. -
Constructor Summary
Constructors Constructor Description IntegrationProperties() -
Method Summary
Modifier and Type Method Description static Propertiesdefaults()intgetChannelsMaxBroadcastSubscribers()Return the value ofCHANNELS_MAX_BROADCAST_SUBSCRIBERSoption.intgetChannelsMaxUnicastSubscribers()Return the value ofCHANNELS_MAX_UNICAST_SUBSCRIBERSoption.static StringgetExpressionFor(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_STARTUPoption.String[]getReadOnlyHeaders()Return the value ofREAD_ONLY_HEADERSoption.intgetTaskSchedulerPoolSize()Return the value ofTASK_SCHEDULER_POOL_SIZEoption.booleanisChannelsAutoCreate()Return the value ofCHANNELS_AUTOCREATEoption.booleanisErrorChannelIgnoreFailures()Return the value ofERROR_CHANNEL_IGNORE_FAILURESoption.booleanisErrorChannelRequireSubscribers()Return the value ofERROR_CHANNEL_REQUIRE_SUBSCRIBERSoption.booleanisMessagingTemplateThrowExceptionOnLateReply()Return the value ofTHROW_EXCEPTION_ON_LATE_REPLYoption.static IntegrationPropertiesparse(Properties properties)Parse a providedPropertiesand build anIntegrationPropertiesinstance.voidsetChannelsAutoCreate(boolean channelsAutoCreate)Configure a value forCHANNELS_AUTOCREATEoption.voidsetChannelsMaxBroadcastSubscribers(int channelsMaxBroadcastSubscribers)Configure a value forCHANNELS_MAX_BROADCAST_SUBSCRIBERSoption.voidsetChannelsMaxUnicastSubscribers(int channelsMaxUnicastSubscribers)Configure a value forCHANNELS_MAX_UNICAST_SUBSCRIBERSoption.voidsetErrorChannelIgnoreFailures(boolean errorChannelIgnoreFailures)Configure a value forERROR_CHANNEL_IGNORE_FAILURESoption.voidsetErrorChannelRequireSubscribers(boolean errorChannelRequireSubscribers)Configure a value forERROR_CHANNEL_REQUIRE_SUBSCRIBERSoption.voidsetMessagingTemplateThrowExceptionOnLateReply(boolean messagingTemplateThrowExceptionOnLateReply)Configure a value forTHROW_EXCEPTION_ON_LATE_REPLYoption.voidsetNoAutoStartupEndpoints(String... noAutoStartupEndpoints)Configure a value forENDPOINTS_NO_AUTO_STARTUPoption.voidsetReadOnlyHeaders(String... readOnlyHeaders)Configure a value forREAD_ONLY_HEADERSoption.voidsetTaskSchedulerPoolSize(int taskSchedulerPoolSize)Configure a value forTASK_SCHEDULER_POOL_SIZEoption.PropertiestoProperties()Represent the current instance as aProperties.
-
Field Details
-
INTEGRATION_PROPERTIES_PREFIX
- See Also:
- Constant Field Values
-
CHANNELS_AUTOCREATE
Specifies whether to allow create automaticallyDirectChannelbeans for non-declared channels or not.- See Also:
- Constant Field Values
-
CHANNELS_MAX_UNICAST_SUBSCRIBERS
Specifies the value forAbstractDispatcher.maxSubscribersin case of point-to-point channels (e.g.ExecutorChannel), if the attributemax-subscribersisn't configured on the channel component.- See Also:
- Constant Field Values
-
CHANNELS_MAX_BROADCAST_SUBSCRIBERS
Specifies the value forAbstractDispatcher.maxSubscribersin case of point-to-point channels (e.g.PublishSubscribeChannel), if the attributemax-subscribersisn't configured on the channel component.- See Also:
- Constant Field Values
-
ERROR_CHANNEL_REQUIRE_SUBSCRIBERS
Specifies the value forPublishSubscribeChannel.requireSubscriberson a global defaultIntegrationContextUtils.ERROR_CHANNEL_BEAN_NAME.- See Also:
- Constant Field Values
-
ERROR_CHANNEL_IGNORE_FAILURES
Specifies the value forPublishSubscribeChannel.ignoreFailureson a global defaultIntegrationContextUtils.ERROR_CHANNEL_BEAN_NAME.- See Also:
- Constant Field Values
-
TASK_SCHEDULER_POOL_SIZE
Specifies the value ofThreadPoolTaskScheduler.poolSizefor thetaskSchedulerbean 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_AUTOCREATEoption.- Parameters:
channelsAutoCreate- the value forCHANNELS_AUTOCREATEoption.
-
isChannelsAutoCreate
public boolean isChannelsAutoCreate()Return the value ofCHANNELS_AUTOCREATEoption.- Returns:
- the value of
CHANNELS_AUTOCREATEoption.
-
setChannelsMaxUnicastSubscribers
public void setChannelsMaxUnicastSubscribers(int channelsMaxUnicastSubscribers)Configure a value forCHANNELS_MAX_UNICAST_SUBSCRIBERSoption.- Parameters:
channelsMaxUnicastSubscribers- the value forCHANNELS_MAX_UNICAST_SUBSCRIBERSoption.
-
getChannelsMaxUnicastSubscribers
public int getChannelsMaxUnicastSubscribers()Return the value ofCHANNELS_MAX_UNICAST_SUBSCRIBERSoption.- Returns:
- the value of
CHANNELS_MAX_UNICAST_SUBSCRIBERSoption.
-
setChannelsMaxBroadcastSubscribers
public void setChannelsMaxBroadcastSubscribers(int channelsMaxBroadcastSubscribers)Configure a value forCHANNELS_MAX_BROADCAST_SUBSCRIBERSoption.- Parameters:
channelsMaxBroadcastSubscribers- the value forCHANNELS_MAX_BROADCAST_SUBSCRIBERSoption.
-
getChannelsMaxBroadcastSubscribers
public int getChannelsMaxBroadcastSubscribers()Return the value ofCHANNELS_MAX_BROADCAST_SUBSCRIBERSoption.- Returns:
- the value of
CHANNELS_MAX_BROADCAST_SUBSCRIBERSoption.
-
setErrorChannelRequireSubscribers
public void setErrorChannelRequireSubscribers(boolean errorChannelRequireSubscribers)Configure a value forERROR_CHANNEL_REQUIRE_SUBSCRIBERSoption.- Parameters:
errorChannelRequireSubscribers- the value forERROR_CHANNEL_REQUIRE_SUBSCRIBERSoption.
-
isErrorChannelRequireSubscribers
public boolean isErrorChannelRequireSubscribers()Return the value ofERROR_CHANNEL_REQUIRE_SUBSCRIBERSoption.- Returns:
- the value of
ERROR_CHANNEL_REQUIRE_SUBSCRIBERSoption.
-
setErrorChannelIgnoreFailures
public void setErrorChannelIgnoreFailures(boolean errorChannelIgnoreFailures)Configure a value forERROR_CHANNEL_IGNORE_FAILURESoption.- Parameters:
errorChannelIgnoreFailures- the value forERROR_CHANNEL_IGNORE_FAILURESoption.
-
isErrorChannelIgnoreFailures
public boolean isErrorChannelIgnoreFailures()Return the value ofERROR_CHANNEL_IGNORE_FAILURESoption.- Returns:
- the value of
ERROR_CHANNEL_IGNORE_FAILURESoption.
-
setTaskSchedulerPoolSize
public void setTaskSchedulerPoolSize(int taskSchedulerPoolSize)Configure a value forTASK_SCHEDULER_POOL_SIZEoption.- Parameters:
taskSchedulerPoolSize- the value forTASK_SCHEDULER_POOL_SIZEoption.
-
getTaskSchedulerPoolSize
public int getTaskSchedulerPoolSize()Return the value ofTASK_SCHEDULER_POOL_SIZEoption.- Returns:
- the value of
TASK_SCHEDULER_POOL_SIZEoption.
-
setMessagingTemplateThrowExceptionOnLateReply
public void setMessagingTemplateThrowExceptionOnLateReply(boolean messagingTemplateThrowExceptionOnLateReply)Configure a value forTHROW_EXCEPTION_ON_LATE_REPLYoption.- Parameters:
messagingTemplateThrowExceptionOnLateReply- the value forTHROW_EXCEPTION_ON_LATE_REPLYoption.
-
isMessagingTemplateThrowExceptionOnLateReply
public boolean isMessagingTemplateThrowExceptionOnLateReply()Return the value ofTHROW_EXCEPTION_ON_LATE_REPLYoption.- Returns:
- the value of
THROW_EXCEPTION_ON_LATE_REPLYoption.
-
setReadOnlyHeaders
Configure a value forREAD_ONLY_HEADERSoption.- Parameters:
readOnlyHeaders- the value forREAD_ONLY_HEADERSoption.
-
getReadOnlyHeaders
Return the value ofREAD_ONLY_HEADERSoption.- Returns:
- the value of
READ_ONLY_HEADERSoption.
-
setNoAutoStartupEndpoints
Configure a value forENDPOINTS_NO_AUTO_STARTUPoption.- Parameters:
noAutoStartupEndpoints- the value forENDPOINTS_NO_AUTO_STARTUPoption.
-
getNoAutoStartupEndpoints
Return the value ofENDPOINTS_NO_AUTO_STARTUPoption.- Returns:
- the value of
ENDPOINTS_NO_AUTO_STARTUPoption.
-
toProperties
Represent the current instance as aProperties.- Returns:
- the
Propertiesrepresentation. - Since:
- 5.5
-
parse
Parse a providedPropertiesand build anIntegrationPropertiesinstance.- Parameters:
properties- thePropertiesto parse entries forIntegrationProperties.- Returns:
IntegrationPropertiesbased on the providedProperties.- Since:
- 5.5
-
defaults
- Returns:
Propertieswith 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 providedkeyisn't an Integration property.
-