DispatchHandler — dispatch to one of a list of handlers
Dispatches to one of a list of handlers. When an exchange is handled,
each handler's condition is evaluated. If a condition
expression yields true, then the exchange is dispatched
to the associated handler with no further processing.
{
"name": string,
"type": "DispatchHandler",
"config": {
"bindings": [
{
"condition": expression,
"handler": string,
"baseURI": string,
}, ...
]
}
}"bindings": array of objects,
requiredA list of bindings of conditions and associated handlers to dispatch to.
"condition": expression,
optionalCondition to evaluate to determine if associated handler should be dispatched to. If omitted, then dispatch is unconditional.
"handler": string, requiredThe name of the handler heap object to dispatch to if the associated
condition yields true.
"baseURI": string, optionalOverrides the existing request URI, making requests relative to a new base URI. Only scheme, host and port are used in the supplied URI. Default: leave URI untouched.
{
"name": "Dispatcher",
"type": "DispatchHandler",
"config": {
"bindings": [
{
"condition": "${exchange.request.uri.path == '/login.php'}",
"handler": "LoginChain",
},
{
"condition": "${exchange.request.uri.path == '/logout.php'}",
"handler": "LogoutChain",
},
{
"handler": "ClientHandler",
}
]
}
}