Hello All,
I have created a proxy without base path. later i have added two resources /test and /test2. Then i got two flows with respective conditions in proxy endpoint. Can i connect to two different target endpoints from these flows. I have created two target endpoints and referred them in two routing rules also. But how to link the condition in resource flow with routing rule.
First of all: Can i connect to different endpoints based on different resources.
Regards,
Ch.Venkat
yes, you can do that
In your proxy endpoint xml, you can add mutliple routerules to route to targets based on condition
<RouteRule name="MyRoute"> <Condition>proxy.pathSuffix MatchesPath "/test"</Condition> <TargetEndpoint>TargetEndpoint1</TargetEndpoint> </RouteRule> <RouteRule name="route2"> <Condition>proxy.pathSuffix MatchesPath "/test1"</Condition> <TargetEndpoint>TargetEndpoint2</TargetEndpoint> </RouteRule> <RouteRule name="default"> <TargetEndpoint>default</TargetEndpoint> </RouteRule>
Refer here, http://apigee.com/docs/api-services/content/unders...
for more details
Hi Madhavan,
yes, by using the routing rules with conditions, we can achieve but my requirement is use the resource feature.
By adding the two resources, i get below conditions in flows.
How to leverage or use these conditions to route calls to respective target endpoints instead of relying on the conditions in routing rules tags.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ProxyEndpoint name="default"> <Description/> <PreFlow name="PreFlow"> <Request/> <Response/> </PreFlow>
<Flows>
<Flow name="test1">
<Description/> <Request/> <Response/>
<Condition>(proxy.pathsuffix MatchesPath "/sfapi/v1/soap") and (request.verb = "GET")</Condition> </Flow>
<Flow name="test2">
<Description/> <Request/> <Response/>
<Condition>(proxy.pathsuffix MatchesPath "/odata/v2/") and (request.verb = "GET")</Condition> </Flow>
</Flows> <PostFlow name="PostFlow"> <Request/> <Response/> </PostFlow>
Regards,
Ch.Venkat.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |