Есть ли способ получить файл из входящего соединителя файла и сгенерировать несколько копий (скажем, 5) одного и того же файла в той же папке или в другом месте? Я попробовал его с компонентом Scatter-Gather, но не получился так, как я ожидал. Помоги пожалуйста?Как сгенерировать несколько копий одного и того же файла с помощью mule
Если предполагается использовать Scatter-Gather, как написать выражение MEL для изменения имени файла, сохраняя исходное расширение? Мой текущий поток мула выглядит следующим образом.
<file:connector name="File_Send" readFromDirectory="C:\Users\AnypointStudio\workspace\MessageOut" autoDelete="true" streaming="true" validateConnections="true" doc:name="File"/>
<file:connector name="File_Receive" autoDelete="true" streaming="true" validateConnections="true" doc:name="File"/>
<spring:beans>
<spring:bean id="readFile" class="java.lang.String">
<spring:constructor-arg>
<spring:bean class="org.springframework.util.FileCopyUtils" factory-method="copyToByteArray">
<spring:constructor-arg type="java.io.InputStream" value="${C:\Users\AnypointStudio\workspace\MessageOut\24730717-99a3-4353-bfcc-d19d3ba7f50a.xml}"/>
</spring:bean>
</spring:constructor-arg>
</spring:bean>
</spring:beans>
<flow name="loop_testFlow">
<file:inbound-endpoint path="C:\Users\AnypointStudio\workspace" connector-ref="File_Send" responseTimeout="10000" doc:name="File"/>
<object-to-byte-array-transformer doc:name="Object to Byte Array"/>
<set-variable variableName="file" value="#[app.registry.readFile]" doc:name="Variable"/>
<scatter-gather doc:name="Scatter-Gather">
<file:outbound-endpoint path="C:\Users\AnypointStudio\workspace\MessageIn" connector-ref="File_Receive" responseTimeout="10000" doc:name="File"/>
<file:outbound-endpoint path="C:\Users\AnypointStudio\workspace\MessageIn" connector-ref="File_Receive" responseTimeout="10000" doc:name="File"/>
</scatter-gather>
</flow>
Пробовал это, но все еще не смог установить определенное количество копий. +1 для выражений MEL. Пригоден для нескольких других операций. Престижность! – user3502734