我是Mule的新手并试图关注http://www.mulesoft.org/documentation/display/current/JDBC+Transport+Reference#JDBCTransportReference-LargeDataset
这是我的mule配置文件
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-mapper" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:jdbc-ee="http://www.mulesoft.org/schema/mule/ee/jdbc" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:jdbc="http://www.mulesoft.org/schema/mule/jdbc" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" xmlns:vm="http://www.mulesoft.org/schema/mule/vm" xmlns:core="http://www.mulesoft.org/schema/mule/core" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="EE-3.4.1" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.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/ee/jdbc http://www.mulesoft.org/schema/mule/ee/jdbc/current/mule-jdbc-ee.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.1/mule-http.xsd
http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/3.1/mule-scripting.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/3.4/mule-vm.xsd
http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd">
<jdbc-ee:oracle-data-source name="Oracle_Local_Data_Source" user="system" password="admin_123" url="jdbc:oracle:thin:@localhost:1521:orcl" transactionIsolation="UNSPECIFIED" doc:name="Oracle Data Source"></jdbc-ee:oracle-data-source>
<jdbc-ee:connector name="Database_JDBC" dataSource-ref="Oracle_Local_Data_Source" validateConnections="true" queryTimeout="-1" pollingFrequency="1000000" doc:name="Database"></jdbc-ee:connector>
<spring:bean id="idStore" class="com.mulesoft.mule.transport.jdbc.util.IdStore">
<spring:property name="fileName" value="/tmp/large-dataset.txt"/>
</spring:bean>
<spring:bean id="seqBatchManager" class="com.mulesoft.mule.transport.jdbc.components.BatchManager">
<spring:property name="idStore" ref="idStore"/>
<spring:property name="batchSize" value="2"/>
<spring:property name="startingPointForNextBatch" value="0"/>
</spring:bean>
<spring:bean id="noArgsWrapper"
class="com.mulesoft.mule.transport.jdbc.components.NoArgsWrapper">
<spring:property name="batchManager" ref="seqBatchManager"/>
</spring:bean>
<flow name="LargeDataSet">
<jdbc-ee:inbound-endpoint queryKey="EmployeeList" queryTimeout="-1" pollingFrequency="1000" connector-ref="Database_JDBC" doc:name="Database">
<jdbc-ee:query key="EmployeeList" value="select * from employee"></jdbc-ee:query>
</jdbc-ee:inbound-endpoint>
<vm:inbound-endpoint exchange-pattern="one-way" path="vm://next.batch"/>
<spring-object bean="noArgsWrapper" />
</flow>
</mule>
但是,在运行mule应用程序时,我收到以下错误:
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'vm:inbound-endpoint'. One of '{"http://www.mulesoft.org/schema/mule/core":abstract-message-processor, "http://www.mulesoft.org/schema/mule/core":abstract-outbound-endpoint, "http://www.mulesoft.org/schema/mule/core":abstract-mixed-content-message-processor, "http://www.mulesoft.org/schema/mule/core":response}' is expected.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
....
我试图在谷歌搜索它但没有得到任何有效的解决方案。 仅供参考 - 我的班级路径中有mule-transport-vm-3.4.1.jar(给出解决此问题的建议之一)
答案 0 :(得分:1)
你不能直接在流中使用spring-object,而是可以使用Java组件并参考spring对象,如下所示。
<component doc:name="Java">
<spring-object bean="noArgsWrapper"/>
</component>
答案 1 :(得分:0)
您不能在同一个流中拥有两个入站端点。你想要达到的目标是什么?在短期内,删除vm:inbound-endpoint。
可能你想让它成为spring-object之后的出站端点?
答案 2 :(得分:0)
你有一个工作和详细的例子:
答案 3 :(得分:0)
如果有多个入站端点在复合范围内定义它们。