Class IntegrationProperties
java.lang.Object
org.springframework.integration.context.IntegrationProperties
public final class IntegrationProperties
extends java.lang.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
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCHANNELS_AUTOCREATESpecifies whether to allow create automaticallyDirectChannelbeans for non-declared channels or not.static java.lang.StringCHANNELS_MAX_BROADCAST_SUBSCRIBERSSpecifies the value forAbstractDispatcher.maxSubscribersin case of point-to-point channels (e.g.static java.lang.StringCHANNELS_MAX_UNICAST_SUBSCRIBERSSpecifies the value forAbstractDispatcher.maxSubscribersin case of point-to-point channels (e.g.static java.lang.StringENDPOINTS_NO_AUTO_STARTUPSpecifies the value ofAbstractEndpoint.autoStartup.static java.lang.StringERROR_CHANNEL_IGNORE_FAILURESSpecifies the value forPublishSubscribeChannel.ignoreFailureson a global defaultIntegrationContextUtils.ERROR_CHANNEL_BEAN_NAME.static java.lang.StringERROR_CHANNEL_REQUIRE_SUBSCRIBERSSpecifies the value forPublishSubscribeChannel.requireSubscriberson a global defaultIntegrationContextUtils.ERROR_CHANNEL_BEAN_NAME.static java.lang.StringINTEGRATION_PROPERTIES_PREFIXstatic java.lang.StringREAD_ONLY_HEADERSSpecifies the value ofDefaultMessageBuilderFactory.readOnlyHeaders.static java.lang.StringTASK_SCHEDULER_POOL_SIZESpecifies the value ofThreadPoolTaskScheduler.poolSizefor thetaskSchedulerbean initialized by the Integration infrastructure.static java.lang.StringTHROW_EXCEPTION_ON_LATE_REPLYSpecifies the value ofGenericMessagingTemplate.throwExceptionOnLateReply. -
Constructor Summary
Constructors Constructor Description IntegrationProperties() -
Method Summary
Modifier and Type Method Description static java.util.Propertiesdefaults()intgetChannelsMaxBroadcastSubscribers()Return the value ofCHANNELS_MAX_BROADCAST_SUBSCRIBERSoption.intgetChannelsMaxUnicastSubscribers()Return the value ofCHANNELS_MAX_UNICAST_SUBSCRIBERSoption.static java.lang.StringgetExpressionFor(java.lang.String key)Build the bean property definition expression to resolve the value from Integration properties within the bean building phase.java.lang.String[]getNoAutoStartupEndpoints()Return the value ofENDPOINTS_NO_AUTO_STARTUPoption.java.lang.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(java.util.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(java.lang.String... noAutoStartupEndpoints)Configure a value forENDPOINTS_NO_AUTO_STARTUPoption.voidsetReadOnlyHeaders(java.lang.String... readOnlyHeaders)Configure a value forREAD_ONLY_HEADERSoption.voidsetTaskSchedulerPoolSize(int taskSchedulerPoolSize)Configure a value forTASK_SCHEDULER_POOL_SIZEoption.java.util.PropertiestoProperties()Represent the current instance as aProperties.
-
Field Details
-
INTEGRATION_PROPERTIES_PREFIX
public static final java.lang.String INTEGRATION_PROPERTIES_PREFIX- See Also:
- Constant Field Values
-
CHANNELS_AUTOCREATE
public static final java.lang.String CHANNELS_AUTOCREATESpecifies whether to allow create automaticallyDirectChannelbeans for non-declared channels or not.- See Also:
- Constant Field Values
-
CHANNELS_MAX_UNICAST_SUBSCRIBERS
public static final java.lang.String CHANNELS_MAX_UNICAST_SUBSCRIBERSSpecifies 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
public static final java.lang.String CHANNELS_MAX_BROADCAST_SUBSCRIBERSSpecifies 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
public static final java.lang.String ERROR_CHANNEL_REQUIRE_SUBSCRIBERSSpecifies the value forPublishSubscribeChannel.requireSubscriberson a global defaultIntegrationContextUtils.ERROR_CHANNEL_BEAN_NAME.- See Also:
- Constant Field Values
-
ERROR_CHANNEL_IGNORE_FAILURES
public static final java.lang.String ERROR_CHANNEL_IGNORE_FAILURESSpecifies the value forPublishSubscribeChannel.ignoreFailureson a global defaultIntegrationContextUtils.ERROR_CHANNEL_BEAN_NAME.- See Also:
- Constant Field Values
-
TASK_SCHEDULER_POOL_SIZE
public static final java.lang.String TASK_SCHEDULER_POOL_SIZESpecifies the value ofThreadPoolTaskScheduler.poolSizefor thetaskSchedulerbean initialized by the Integration infrastructure.- See Also:
- Constant Field Values
-
THROW_EXCEPTION_ON_LATE_REPLY
public static final java.lang.String THROW_EXCEPTION_ON_LATE_REPLYSpecifies the value ofGenericMessagingTemplate.throwExceptionOnLateReply.- See Also:
- Constant Field Values
-
READ_ONLY_HEADERS
public static final java.lang.String READ_ONLY_HEADERSSpecifies the value ofDefaultMessageBuilderFactory.readOnlyHeaders.- See Also:
- Constant Field Values
-
ENDPOINTS_NO_AUTO_STARTUP
public static final java.lang.String ENDPOINTS_NO_AUTO_STARTUPSpecifies 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
public void setReadOnlyHeaders(java.lang.String... readOnlyHeaders)Configure a value forREAD_ONLY_HEADERSoption.- Parameters:
readOnlyHeaders- the value forREAD_ONLY_HEADERSoption.
-
getReadOnlyHeaders
public java.lang.String[] getReadOnlyHeaders()Return the value ofREAD_ONLY_HEADERSoption.- Returns:
- the value of
READ_ONLY_HEADERSoption.
-
setNoAutoStartupEndpoints
public void setNoAutoStartupEndpoints(java.lang.String... noAutoStartupEndpoints)Configure a value forENDPOINTS_NO_AUTO_STARTUPoption.- Parameters:
noAutoStartupEndpoints- the value forENDPOINTS_NO_AUTO_STARTUPoption.
-
getNoAutoStartupEndpoints
public java.lang.String[] getNoAutoStartupEndpoints()Return the value ofENDPOINTS_NO_AUTO_STARTUPoption.- Returns:
- the value of
ENDPOINTS_NO_AUTO_STARTUPoption.
-
toProperties
public java.util.Properties 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
public static java.util.Properties defaults()- Returns:
Propertieswith default values for Integration properties.
-
getExpressionFor
public static java.lang.String getExpressionFor(java.lang.String key)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:
java.lang.IllegalArgumentException- if providedkeyisn't an Integration property.
-