Mapping for Custom Cloud Hot Folder Flows
Learn how to add a mapping to your custom hot folder flows.
The following Spring configuration defines the path for downloaded files.
This configuration is similar to the standard hot folders configuration, where the file Inbound Adapter is replaced with a mapping entry.
<!-- 1) add mapping so that the file is passed onto your channel when it is downloaded -->
<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetObject" ref="hotfolderInboundFileChannelMappings"/>
<property name="targetMethod" value="put"/>
<property name="arguments">
<list>
<bean class="java.util.regex.Pattern" factory-method="compile">
<constructor-arg value="^yourHotFolderPattern.*" />
</bean>
<ref bean="yourHotFolderChannel"/>
</list>
</property>
</bean>
<int:channel id="yourHotFolderChannel"/>
<!-- 2) move the file to processing and setup header -->
<file:outbound-gateway id="yourHotFolderOutboundChannel"
request-channel="yourHotFolderChannel"
reply-channel="yourHotFolderBatchFilesProc"
directory="#{baseLocalDirectory}/yourHotFolder/processing"
delete-source-files="true" />
<!-- normal hot folder spring setup below -->
<int:service-activator input-channel="yourHotFolderBatchFilesProc">
.........
.........
<aop:aspect ref="batchHeaderAspectBean" id="zipBatchHeaderAspect">
<aop:around method="aroundMessageSetup"
pointcut="execution(* de.hybris.platform.cloud.hotfolder.dataimport.batch.zip.task.ZipHeaderSetupTask.execute(..)) and args(message)"/>
...
...
<aop:aspect ref="batchHeaderAspectBean" id="fileBatchHeaderAspect">
<aop:around method="aroundFileSetup"
pointcut="execution(* de.hybris.platform.acceleratorservices.dataimport.batch.task.HeaderSetupTask.execute(..)) and args(file)"/>
...
...