<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="direct:start"/>
<unmarshal>
<castor validation="true" />
</unmarshal>
<to uri="mock:result"/>
</route>
</camelContext>
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="direct:start"/>
<unmarshal>
<castor validation="true" />
</unmarshal>
<to uri="mock:result"/>
</route>
</camelContext>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
이 예에서는 데이터 유형을 한 번만 구성하고 여러 경로에 재사용하는 방법을 보여줍니다. <camelContext>에서 <castor> 요소를 직접 설정해야 합니다.
<camelContext>
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
<dataFormats>
<castor id="myCastor"/>
</dataFormats>
<route>
<from uri="direct:start"/>
<marshal ref="myCastor"/>
<to uri="direct:marshalled"/>
</route>
<route>
<from uri="direct:marshalled"/>
<unmarshal ref="myCastor"/>
<to uri="mock:result"/>
</route>
</camelContext>
<camelContext>
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
<dataFormats>
<castor id="myCastor"/>
</dataFormats>
<route>
<from uri="direct:start"/>
<marshal ref="myCastor"/>
<to uri="direct:marshalled"/>
</route>
<route>
<from uri="direct:marshalled"/>
<unmarshal ref="myCastor"/>
<to uri="mock:result"/>
</route>
</camelContext>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow