问题
I'd like to dynamically change some of the parameters of my inbound endpoint. More precisely, I have a RabbitMQ inbound endpoint, and I would like to dynamically specify server host name, port, queue name, etc. How can I do this?
BTW, if it cannot be done with the existing components that's fine. It would also be great/acceptable if I could for example create a custom mediator that would read these properties from the message context and then somehow modify the RabbitMQ inbound endpoint, just how?
回答1:
Specifying inbound endpoint parameters as registry values.
Other than specifying parameter values inline, you can also specify parameter values as registry entries. The advantage of specifying a parameter value as a registry entry is that the same inbound endpoint configuration can be used in different environments simply by changing the registry entry value.
<inboundEndpoint xmlns="http://ws.apache.org/ns/synapse" name="file" sequence="request" onError="fault" protocol="file" suspend="false">
<parameters>
...............
<parameter name="transport.vfs.FileURI" key="conf:/repository/esb/esb-configurations/test"/>
...............
</parameters>
</inboundEndpoint>
Refer [1] for detailed explanation.
[1] - https://docs.wso2.com/display/ESB490/Working+with+Inbound+Endpoints
来源:https://stackoverflow.com/questions/37543686/dynamic-configuration-of-the-wso2esb-inbound-endpoints