如果我在 Oracle 表中有 100 行,我希望收到一封正文中包含 100 行的电子邮件,而不是收到 100 封电子邮件,每行一封……我认为 transactionPerMessage 会做到这一点(工具提示说,“如果false,整个结果集将有一个事务”),但无论我将其设置为 true 还是 false,都没有区别。
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:smtp="http://www.mulesoft.org/schema/mule/smtp" xmlns:jbossts="http://www.mulesoft.org/schema/mule/jbossts" xmlns:jdbc="http://www.mulesoft.org/schema/mule/jdbc" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="CE-3.3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/smtp http://www.mulesoft.org/schema/mule/smtp/current/mule-smtp.xsd
http://www.mulesoft.org/schema/mule/jdbc http://www.mulesoft.org/schema/mule/jdbc/current/mule-jdbc.xsd
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/jbossts http://www.mulesoft.org/schema/mule/jbossts/current/mule-jbossts.xsd ">
<jdbc:oracle-data-source name="Oracle_Data_Source" user="test" password="test" url="jdbc:oracle:thin:@//ora:1530/TEST.EXAMPLE.COM" transactionIsolation="UNSPECIFIED" doc:name="Oracle Data Source"/>
<jdbc:connector name="Database" dataSource-ref="Oracle_Data_Source" validateConnections="true" transactionPerMessage="false" queryTimeout="-1" pollingFrequency="5000" doc:name="Database"/>
<flow name="Ross_invoice_Workflow2Flow1" doc:name="Ross_invoice_Workflow2Flow1">
<jdbc:inbound-endpoint queryKey="GetUnprocessedInvoices" queryTimeout="-1" pollingFrequency="1000" connector-ref="Database" doc:name="Database">
<jdbc:query key="GetUnprocessedInvoices" value="SELECT INVOICE_NUMBER FROM FIN.LHF_INVOICE_WORKFLOW WHERE (STATUS_FLAG = 'N')"/>
</jdbc:inbound-endpoint>
<echo-component doc:name="Echo"/>
<smtp:outbound-endpoint host="mail.example.com" to="test@example.com" from="mule@example.com" subject="invoice test" responseTimeout="10000" doc:name="SMTP"/>
</flow>
</mule>