Solved! Go to Solution.
You can use the <RouteRule> tag to direct a request to a target based on a condition. Please read the section "Conditional targets" in this link for more details including an example for routing based on header.
Here's a sample code that shows how to do this using query parameter:
<RouteRule name="Route1"> <Condition>request.queryparam.routeTo = "TargetEndpoint1"</Condition> <TargetEndpoint>TargetEndpoint1</TargetEndpoint> </RouteRule> <RouteRule name="Route2"> <Condition>request.queryparam.routeTo = "TargetEndpoint2"</Condition> <TargetEndpoint>TargetEndpoint2</TargetEndpoint> </RouteRule> <RouteRule name="default"> <TargetEndpoint>TargetEndpointDefault</TargetEndpoint> </RouteRule>
Regards,
Amar
You can use the <RouteRule> tag to direct a request to a target based on a condition. Please read the section "Conditional targets" in this link for more details including an example for routing based on header.
Here's a sample code that shows how to do this using query parameter:
<RouteRule name="Route1"> <Condition>request.queryparam.routeTo = "TargetEndpoint1"</Condition> <TargetEndpoint>TargetEndpoint1</TargetEndpoint> </RouteRule> <RouteRule name="Route2"> <Condition>request.queryparam.routeTo = "TargetEndpoint2"</Condition> <TargetEndpoint>TargetEndpoint2</TargetEndpoint> </RouteRule> <RouteRule name="default"> <TargetEndpoint>TargetEndpointDefault</TargetEndpoint> </RouteRule>
Regards,
Amar
You can use the <RouteRule> tag to direct a request to a target based on a condition. Please read the section "Conditional targets" in this link for more details including an example for routing based on header.
Here's a sample code that shows how to do this using query parameter:
<RouteRule name="Route1"> <Condition>request.queryparam.routeTo = "TargetEndpoint1"</Condition> <TargetEndpoint>TargetEndpoint1</TargetEndpoint> </RouteRule> <RouteRule name="Route2"> <Condition>request.queryparam.routeTo = "TargetEndpoint2"</Condition> <TargetEndpoint>TargetEndpoint2</TargetEndpoint> </RouteRule> <RouteRule name="default"> <TargetEndpoint>TargetEndpointDefault</TargetEndpoint> </RouteRule>
Regards,
Amar