鉴于我有一个使用XML配置的传统Camel应用程序,我有许多具有通用参数的路由。 E.g。
<camel:camelContext>
<camel:endpoint id=sampleEndpoint1" uri="user1@host.com/inbound?password=password1&readLock=none&delete=true&include=.*.xml&disconnect=false&knownHostsFile=/tmp/known_hosts&serverAliveInterval=30&preferredAuthentications=password&ciphers=arcfour128,aes128-ctr,aes192-ctr,aes256-ctr"/>
<camel:endpoint id=sampleEndpoint2" uri="user2@host.com/inbound?password=password2&readLock=none&delete=true&include=.*.xml&disconnect=false&knownHostsFile=/tmp/known_hosts&serverAliveInterval=30&preferredAuthentications=password&ciphers=arcfour128,aes128-ctr,aes192-ctr,aes256-ctr"/>
<camel:endpoint id=sampleEndpoint3" uri="user3@host.com/inbound?password=password3&readLock=none&delete=true&include=.*.xml&disconnect=false&knownHostsFile=/tmp/known_hosts&serverAliveInterval=30&preferredAuthentications=password&ciphers=arcfour128,aes128-ctr,aes192-ctr,aes256-ctr"/>
</camel:camelContext>
密码参数后,路径定义中的所有其余参数都相同。
路由是否有办法以类似于Spring bean配置的方式继承公共参数,您可以从父 bean继承属性?