Skip to main content

Looking up using consumer policy

With Talend ESB, you can use a custom attribute in the Policy Attachment and distinguish a consumer policy in the Service Registry REST Service. The Service API will be updated to support additional attributes. The Persistence layer is not changed.

The Service Registry REST Service API is extended to support the possibility to get consumer and provider policies:

@GET
@Produces({ "multipart/mixed;type=application/wspolicy+xml" })
@Path("/policy/consumer/{serviceQName}")
Response lookupConsumerPolicy(@PathParam("serviceQName") String serviceQName,
                              @QueryParam("consumerPolicyAlias") String consumerPolicyAlias);
@GET
@Produces({ "multipart/mixed;type=application/wspolicy+xml" })
@Path("/policy/provider/{serviceQName}")
Response lookupProviderPolicy(@PathParam("serviceQName") String serviceQName);

The lookupConsumerPolicy method returns the consumer policy with consumerPolicyAlias, which is provided as a method parameter;

The lookupProviderPolicy method returns all provider policies for service which name is provider as method parameter;

The existing lookupPolicy method is changed to support new optional parameters: policyType and consumerPolicyAlias:

@GET
@Produces({ "multipart/mixed;type=application/wspolicy+xml" })
@Path("/policy/{serviceQName}")
Response lookupPolicy(@PathParam("serviceQName") String serviceQName,
                      @QueryParam("policyType") String policyType,
                      @QueryParam("consumerPolicyAlias") String consumerPolicyAlias);

The lookupPolicy method is changed (extended) to support receiving consumer, default, or provider policies. This new implementation of this method is compatible with the previous versions of the Service Registry clients:

policyType
consumerPolicyAlias
lookupPolicy
not set any value or not set provider policies (for backwards compatibility)
consumer not set default consumer policies (or provider policies, in case the default consumer policy does not exist)
consumer some consumer policy alias policies with specified consumer policy alias
provider any value or not set all provider policies

Note that the provider policies for the consumer policy type will be retrieved ONLY if consumer policy alias is not specified and no default consumer policies are registered for the whole service. Otherwise the consumer policy will be retrieved and applied independently on scope specified inside the policy.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!