Привет, я работаю с Any Point Studio, и у меня есть сценарий, где Mule читает с пути, предположим, что он читает 2 файла с некоторого пути и обрабатывает как файлы как два отдельных сообщения, которые я хочу объединить как в одном, так и в одном.Как объединить несколько сообщений в одно сообщение и напечатать в Mule
Я также хочу знать использование MULE_CORRELATION_GROUP_SIZE
, почему нам нужно его определить перед компонентом агрегатора?
Просьба поделиться кодами для достижения этой цели с помощью Custom Aggregator или их лучшим способом.
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
\t xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.5.0"
\t xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
\t xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd">
<file:connector name="File" streaming="true" autoDelete="false" validateConnections="true" doc:name="File"/>
<flow name="mule-file-aggregatorFlow1" doc:name="mule-file-aggregatorFlow1">
<file:inbound-endpoint path="\\mulespace\foldername" responseTimeout="10000" doc:name="File" connector-ref="File">
</file:inbound-endpoint>
<file:file-to-string-transformer doc:name="File to String"/>
<message-properties-transformer doc:name="Message Properties">
<add-message-property key="MULE_CORRELATION_GROUP_SIZE" value="2" />
</message-properties-transformer>
<custom-aggregator failOnTimeout="true" class="com.mine.custom.CustomAggregator" doc:name="Custom Aggregator"/>
<json:object-to-json-transformer doc:name="Object to JSON"/>
<logger message="#[message.payload]" level="INFO" doc:name="Logger"/>
</flow>
</mule>
Можете ли вы описать шаблон имени файлов? –
это обычный .txt файл – Utsav
Я имею в виду шаблон имени. Как вы должны связывать эти два файла? –