specifying proxy endpoint

is there a way in apigee to handle multiple endpoint efficiently rather hard coding for each resource call with assign message policy at target end point?

Solved Solved
0 7 6,200
2 ACCEPTED SOLUTIONS

Hi Kuldeep - If you're wanting to set up dynamic routing to different endpoints, check out this topic: http://apigee.com/docs/api-services/reference/api-proxy-configuration-reference

View solution in original post

Not applicable

To add to Floyds reference - you can use any information you have available in the request - query params, headers, uri, etc to create route rules to target servers.

We have a client that requires that different target servers be invoked based on regions around the globe. In that case they have a URI structure that includes a couple of variables that we use in RouteRules.

For example the URI path of /us/v1/profile/me/catalog/foo/123 will route traffic to a different target server than /uk/v1/profile/me/catalog/foo/123. The variables for this are resolved in an extract policy that looks like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<ExtractVariables async="false" continueOnError="true" enabled="true" name="extractCatalogVariables">
    <DisplayName>extractCatalogVariables</DisplayName>
    <Variable name="request.uri">
    	<!-- work from most specific to least specific-->
        <Pattern>/{region}/{version}/profile/*/catalog/{catalog.type}/{catalog.id}</Pattern>

Route rules in the default proxy flow then can make decisions about where to send the target request using the region variable:

<RouteRule name="catalog-us">
        <Condition>(region == us)</Condition>
        <TargetEndpoint>catalog-us</TargetEndpoint>
</RouteRule>

View solution in original post

7 REPLIES 7

Could you please elaborate your question a little bit more. Are you asking how to define a single api proxy with different proxy endpoint or a single proxy routing to different targets endpoints based on some condition?

Divya,

Thanks for the response, I in fact meant first - "how to define a single api proxy with different proxy endpoint", but do not see any harm in knowing second one as well 😛

Kuldeep,

In order to define a single apiproxy, you need to first create an apiproxy with some basepath.

Once the apiproxy is created, you then need to add a 'New Endpoint' under the proxy endpoint section.

In the new Proxy endpoint you would need to define the Basepath of this new Proxy endpoint.

Attached is the screenshot.

133-screen-shot-2015-02-20-at-105131-am.png

Hi Kuldeep - If you're wanting to set up dynamic routing to different endpoints, check out this topic: http://apigee.com/docs/api-services/reference/api-proxy-configuration-reference

Not applicable

To add to Floyds reference - you can use any information you have available in the request - query params, headers, uri, etc to create route rules to target servers.

We have a client that requires that different target servers be invoked based on regions around the globe. In that case they have a URI structure that includes a couple of variables that we use in RouteRules.

For example the URI path of /us/v1/profile/me/catalog/foo/123 will route traffic to a different target server than /uk/v1/profile/me/catalog/foo/123. The variables for this are resolved in an extract policy that looks like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<ExtractVariables async="false" continueOnError="true" enabled="true" name="extractCatalogVariables">
    <DisplayName>extractCatalogVariables</DisplayName>
    <Variable name="request.uri">
    	<!-- work from most specific to least specific-->
        <Pattern>/{region}/{version}/profile/*/catalog/{catalog.type}/{catalog.id}</Pattern>

Route rules in the default proxy flow then can make decisions about where to send the target request using the region variable:

<RouteRule name="catalog-us">
        <Condition>(region == us)</Condition>
        <TargetEndpoint>catalog-us</TargetEndpoint>
</RouteRule>

Hi I have similar type of question just like above. I am new to apigee, I want to place the API proxy on this platform for my API.

I wanted to take the parameter from the proxy url and change the Target endpoint path.

For Example.

http://proxy-server/{category}

to

http://target-server/categories/{category}/products.