webMethods and Intelligent Business Operations 10.2 | API Gateway User's Guide | Policies | System-defined Stages and Policies | Routing | Context-based Routing
 
Context-based Routing
If you have a native API that is hosted at two or more endpoints, you can use the Context-based protocol to route specific types of messages to specific endpoints. The requests are routed according to the context-based routing rules you create. For example, if your entry protocol is HTTP or HTTPS, you can select the Context-based routing. A routing rule specifies where requests should be routed, and the criteria by which they should be routed there. You may specify how to authenticate requests.
The table lists the properties that you can specify for this policy:
Parameter
Description
Default Route To. Specifies the URLs of two or more native services in a pool to which the requests are routed.
Endpoint URI
Specifies the URL of the native API endpoint to route the request to in case all routing rules evaluate to False.
HTTP Method
This is applicable to REST-based APIs.
Specifies the available routing methods: GET, POST, PUT, DELETE, and CUSTOM (default).
When CUSTOM is selected, the HTTP method in the incoming request is sent to the native service. When other methods are selected, the selected method is used in the request sent to the native service.
Note: Software AG recommends to use Request Transformation > Method Transformation to achieve this as other transformations can also be done under the same policy.
SOAP Optimization Method
This is applicable for SOAP-based APIs.
Specifies the optimization methods that API Gateway can use to parse SOAP requests to the native API.
Select one of the following options:
*MTOM.API Gateway uses the Message Transmission Optimization Mechanism (MTOM) to parse SOAP requests to the API.
*SwA. API Gateway uses the SOAP with Attachment (SwA) technique to parse SOAP requests to the API.
*None. API Gateway does not use any optimization method to parse the SOAP requests to the API. This is selected by default.
HTTP Connection Timeout (seconds)
Specifies the time interval (in seconds) after which a connection attempt times out.
If a value 0 is specified (or if the value is not specified), API Gateway uses the default value 30 seconds.
Read Timeout (seconds)
Specifies the time interval (in seconds) after which a socket read attempt times out.
If a value 0 is specified (or if the value is not specified), API Gateway uses the default value 30 seconds.
SSL Configuration. Specifies values to enable SSL client authentication that API Gateway uses to authenticate incoming requests for the native API.
Keystore Alias
Specifies the keystore alias of the instance of Integration Server on which API Gateway is running. This value (along with the value of Client Certificate Alias) is used for performing SSL client authentication.
Key Alias
Specifies the alias for the private key, which must be stored in the keystore specified by the keystore alias.
Pass WS-Security Headers
This is applicable for SOAP-based APIs.
Selecting this indicates that API Gateway should pass the WS-Security headers of the incoming requests to the native API.
Rule. Defines the routing decisions based on one of the following routing options.
Name
Provide a name for the rule.
Condition Operator
Specifies the condition operator to be used.
Select one of the following operators:
*OR. Specifies that one of the set conditions should be applied.
*AND. Specifies all the set conditions should be applied.
Condition
Specify the context variables for processing client requests.
Variable
Select any of the following variables:
*Consumer. Specifies the name of the consumer application in the text box.
*Variable Value. Provide a value in the Variable Value text box.
*Date
*Operator. Select an operator: After or Before .
*Variable Value. Type a date value in the text box.
*IPV4. Specifies that IP version to be IPV4.
*From IP.Type an IP address range.
*To IP. Type an IP address range.
*IPV6. Specifies that IP version to be IPV4.
*From IP. Type an IP address range.
*To IP. Type an IP address range.
*Predefined Context Variable
*Predefined Context. Select a predefined context.
*Operator. Select one of the following operators: Equal To or Not Equal To.
*Variable Value. Type a value for the selected predefined context.
*Custom Context Variable
*Variable Name. Type a name for the custom context variable. Use the pub.apigateway.ctxvar:setContextVariable API for setting the value for the custom context variable. All custom-defined context variables must be declared in a custom namespace that is identified by using the prefix mx (for example, mx:CUSTOM_VARIABLE). All parameter names are case-sensitive. For more information on pub.apigateway.ctxvar:setContextVariable service, see The API for Context Variables.
*Data Type. Select the data type: String or Integer.
*Operator. Select one of the following operators based on the Data Type selected:
*String: Equal To or Not Equal To
*Integer: Equal To, Not Equal To, Greater Than, or Less Than
*Variable Value. Type a value for the selected custom context.
*Time
*Operator. Select an operator: After or Before.
*Hours. Type a time value in hours.
*Minutes. Type a time value in minutes.
Route To. Specifies the endpoint URI of native services in a pool to which the requests are routed.
Endpoint URI
Specifies the URI of the native API endpoint to route the request to.
HTTP Method
This is applicable for REST-based APIs.
Specifies the available routing methods: GET, POST, PUT, DELETE, and CUSTOM (default).
When CUSTOM is selected, the HTTP method in the incoming request is sent to the native service. When other methods are selected, the selected method is used in the request sent to the native service.
Soap Optimization Method
This is applicable for SOAP-based APIs.
Specifies values to enable SSL authentication for SOAP APIs.
Select one of the following options:
*MTOM. API Gateway uses the Message Transmission Optimization Mechanism (MTOM) to parse SOAP requests to the API.
*SwA. API Gateway uses the SOAP with Attachment (SwA) technique to parse SOAP requests to the API.
*None. API Gateway does not use any optimization method to parse the SOAP requests to the API. This is selected by default.
HTTP Connection Timeout (seconds)
Specifies the time interval (in seconds) after which a connection attempt times out.
If a value 0 is specified (or if the value is not specified), API Gateway uses the default value 30 seconds.
Read Timeout (seconds)
Specifies the time interval (in seconds) after which a socket read attempt timesout.
If a value 0 is specified (or if the value is not specified), API Gateway uses the default value 30 seconds.
Pass WS-Security Headers
This is applicable for SOAP-based APIs.
Selecting this indicates that API Gateway should pass the WS-Security headers of the incoming requests to the native API.
SSL Configuration
Specifies values to enable SSL client authentication that API Gateway uses to authenticate incoming requests for the native API.
Provide the following information:
*Keystore Alias. Specifies the keystore alias of the instance of Integration Server on which API Gateway is running. This value (along with the value of Client Certificate Alias) is used for performing SSL client authentication
*Key Alias. Specifies the alias for the private key, which must be stored in the keystore specified by the keystore alias.

Copyright © 2015- 2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release