Endpoint template is a generalized form of endpoint configuration used in ESB. Unlike sequence templates, endpoint templates are always parametrized using
$ prefixed values (not XPath expressions).
Template endpoint is the artifact that makes a template of endpoint type into a concrete endpoint. In other words, an endpoint template would be useless without a template endpoint referring to it. This is semantically similar to the relationship between a sequence template and the Call Template Mediator.
For example, let's say we have two default endpoints with following hypothetical configurations:
We can see that these two endpoints have different set of error codes and different progression factors for suspension. Furthermore, the number of retries is different between them. By defining a endpoint template, these two endpoints can be converged to a generalized form. This is illustrated in the following:
$ is used to parametrize configuration and
$name is an implicit/default parameter.
Since we have a template defined, we can use template endpoints to create two concrete endpoint instances with different parameter values for this scenario. This is shown below.
As with the Call Template Mediator, the above template endpoint will stereotype endpoints with customized configuration parameters. This makes it very easy to understand and maintain certain ESB configurations and improves re-usability in a certain way.
Similar to sequence templates, endpoint templates are defined as top level element (with the name specified by the name attribute) of ESB configuration. Parameters (for example,
<parameter>) are the inputs supported by this endpoint template. These endpoint template parameters can be referred by
$ prefixed parameter name. For example, parameter named
foo can be referred by
$foo. Most of the parameters of the endpoint definition can be parametrized with
$ prefixed values. This is shown in the following extract:
$uri are default parameters that a template can use anywhere within the endpoint template (usually used as parameters for endpoint name and address attributes).
Template Endpoint Sample
Template endpoint defines parameter values that can parametrize endpoint. The
template attribute points to a target endpoint template.
Parameter names has to be exact match to the names specified in target endpoint template.
For more information about templates, see Templates.