Sometimes a finer grained control of endpoints for a specific service a client gets when retrieving the endpoints is needed. For this purpose you can define additional metadata for an endpoint, such as the country for which the endpoint is only valid or the bandwith it provides. The client on the other side may define the metadata it requires from the endpoint from which a service call is to be made.
Service Locator enabled endpoint with additional metadata
<reference id="locatorFeature" interface="org.talend.esb.servicelocator.cxf.LocatorFeature"/>
<jaxws:endpoint xmlns:tns="http://talend.org/esb/examples/" id="greeter"
implementor="demo.service.GreeterImpl"
serviceName="tns:GreeterService" address="/GreeterService">
<jaxws:properties>
<entry key="esb.locator.properties">
<map>
<entry key="country" value="Luxembourg, Belgium"/>
<entry key="bandwith" value="Class A"/>
</map>
</entry>
</jaxws:properties>
<jaxws:features>
<ref component-id="locatorFeature"/>
</jaxws:features>
</jaxws:endpoint>
In the example above, the endpoint provides a metadata entry for
country
with the values Luxembourg
and
Belgium
and an entry for bandwith
with value
Class A
.
Service Locator enabled client with additional metadata requirements
<reference id="locatorFeature" interface="org.talend.esb.servicelocator.cxf.LocatorFeature"/>
<jaxws:client xmlns:tns="http://talend.org/esb/examples/" id="GreeterClient"
serviceName="tns:GreeterService" address="locator://">
<jaxws:properties>
<entry key="esb.locator.properties">
<map>
<entry key="country" value="Belgium"/>
</map>
</entry>
</jaxws:properties>
<jaxws:features>
<ref component-id="locatorFeature"/>
</jaxws:features>
</jaxws:client>
In the example above, the client requires the endpoint to have a metadata entry
for country
that at least includes Belgium
as
value.