我在camel配置中有两个route
ROUTE1
<route>
<from uri="cxf:bean:soapProxy1?dataFormat=PAYLOAD" />
<setHeader headerName="CamelHttpMethod">
<constant>POST</constant>
</setHeader>
<setHeader headerName="Contents-type">
<constant>application/octet-stream</constant>
</setHeader>
<setHeader headerName="SOAPAction">
<constant>vc</constant>
</setHeader>
<setHeader headerName="Accept">
<constant>application/xml</constant>
</setHeader>
<to uri="bean:samlWsBean" />
<choice>
<when>
<simple>${in.header.isvalid} contains "true"</simple>
<to uri="cxf:bean:backendService?dataFormat=PAYLOAD"/>
</when>
<otherwise>
<to uri="velocity:file:///path/samlerrorresponse.vm"/>
</otherwise>
</choice>
</route>
路径2
<route>
<from uri="cxf:bean:soapProxy2?dataFormat=PAYLOAD" />
<setHeader headerName="CamelHttpMethod">
<constant>POST</constant>
</setHeader>
<setHeader headerName="Contents-type">
<constant>application/octet-stream</constant>
</setHeader>
<setHeader headerName="SOAPAction">
<constant>vc</constant>
</setHeader>
<setHeader headerName="Accept">
<constant>application/xml</constant>
</setHeader>
<to uri="bean:samlWsBean" />
<choice>
<when>
<simple>${in.header.isvalid} contains "true"</simple>
<to uri="cxf:bean:backendService?dataFormat=PAYLOAD"/>
</when>
<otherwise>
<to uri="velocity:file:///path/samlerrorresponse.vm"/>
</otherwise>
</choice>
</route>
两条路线只有一条线差异。
一个人有这个
<from uri="cxf:bean:soapProxy1?dataFormat=PAYLOAD" />
另一个有这个
<from uri="cxf:bean:soapProxy2?dataFormat=PAYLOAD" />
我可以将普通的身体放在配置中的其他地方并在两条路线中引用吗?