These steps describe how to enhance the S3MultipleBuckets subsystem sample by adding specific configuration for each S3 store.
By default, the Common configuration section in s3-mb-contentstore-context.xml defines the client configuration and
retry policy shared by all stores. You can duplicate this section in case you need a specific configuration for one of
the stores.
-
Locate the file
s3-mb-contentstore-context.xml, for example:$CATALINA_HOME/shared/classes/alfresco/extension/subsystems/ContentStore/S3MultipleBuckets/S3MultipleBuckets/s3-mb-contentstore-context.xml -
Duplicate the Common configuration section:
<bean id="s3RetryPolicy" class="com.amazonaws.retry.RetryPolicy"> <constructor-arg ref="s3RetryCondition"/> <constructor-arg> <util:constant static-field="com.amazonaws.retry.PredefinedRetryPolicies.DEFAULT_BACKOFF_STRATEGY"/> </constructor-arg> <constructor-arg value="${connector.s3.maxErrorRetries}"/> <constructor-arg value="false" /> </bean> <!-- Client configuration options such as proxy settings, user agent string, max retry attempts, etc. --> <bean id="s3ClientConfiguration" class="com.amazonaws.ClientConfiguration"> <!-- Sets the retry policy upon failed requests. --> <property name="retryPolicy" ref="s3RetryPolicy"/> <!-- Sets whether throttled retries should be used --> <property name="useThrottleRetries" value="true"/> <property name="requestTimeout" value="${connector.s3.store2.httpRequestTimeout}" /> </bean> -
Add a specific store prefix (e.g.
store2.) to the bean names and properties.For example:
<bean id="store2.s3RetryPolicy" class="com.amazonaws.retry.RetryPolicy"> <constructor-arg ref="s3RetryCondition"/> <constructor-arg> <util:constant static-field="com.amazonaws.retry.PredefinedRetryPolicies.DEFAULT_BACKOFF_STRATEGY"/> </constructor-arg> <constructor-arg value="${connector.s3.store2.maxErrorRetries}"/> <constructor-arg value="false" /> </bean> <!-- Client configuration options such as proxy settings, user agent string, max retry attempts, etc. --> <bean id="store2.s3ClientConfiguration" class="com.amazonaws.ClientConfiguration"> <!-- Sets the retry policy upon failed requests. --> <property name="retryPolicy" ref="store2.s3RetryPolicy"/> <!-- Sets whether throttled retries should be used --> <property name="useThrottleRetries" value="true"/> <property name="requestTimeout" value="${connector.s3.store2.httpRequestTimeout}" /> </bean> -
Update the
s3ClientConfigurationinstore2.s3Adapter.For example:
<property name="clientConfiguration" ref="store2.s3ClientConfiguration"/>