PLivesey
PLivesey

Reputation: 196

Dynamically constructing the endpoint in a WSO2ESB Callout Mediator

I am trying to use a Callout Mediator to call one of two endpoints (stored in the registry), based on a property of the message. The way I would like to do this would be essentially concatenating some properties to provide the path of an endpoint, or by using XPATH if that is not possible.

I know that, using a Send Mediator, XPATH is a possible option for choosing an endpoint, e.g.

<send xmlns:ns="http://ws.apache.org/ns/synapse">
  <endpoint key-expression="//ns:abc"/>
</send>

However, this syntax doesn't seem to work using the Callout Mediator.

Unfortunately my current "solution" to this problem is to have a filter based on this property and n cases, where n is the number of different endpoints I am considering. However, I was hoping to not require a change to the sequence if I added a new endpoint- simply a difference in the message.

Upvotes: 1

Views: 324

Answers (1)

PLivesey
PLivesey

Reputation: 196

This doesn't seem possible in the current implementation of the Callout Mediator.

I ultimately decided to write my own mediator. It is essentially a copy of the CalloutMediator but adds the functionality of using xpath for endpoints.

Upvotes: 1

Related Questions