Content-based Routing
If you have a native API that is hosted at two or more endpoints, you can use the Content-based routing protocol to route specific types of messages to specific endpoints. You can route messages to different endpoints based on specific values that appear in the request message. You might use this capability, for example, to determine which operation the consuming application has requested, and route requests for complex operations to an endpoint on a fast machine. For example, if your entry protocol is HTTP or HTTPS, you can select the Content-based routing. The requests are routed according to the content-based routing rules you create. You may specify how to authenticate requests.
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 URI of the native API
endpoint to route the request to in case all routing rules evaluate to False.
Service registries that have been added to the
Microgateway
instance are also included in the list.
Note: Only simple aliases, endpoint aliases, and service
registry aliases are supported in
Microgateway.
If you choose a service registry, Microgateway sends a request to the service registry to discover the IP address and port at which the native service is running. Microgateway replaces the service registry alias in the Endpoint URI with the IP address and port returned by the service registry. For example, if your service is hosted at the URL:
|
HTTP Method |
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.
|
HTTP Connection Timeout (seconds) | Specifies the time interval (in seconds)
after which a connection attempt times out.
The precedence of the Connection Timeout configuration is as follows:
|
Read Timeout (seconds) | Specifies the time interval (in seconds)
after which a socket read attempt times out.
The precedence of the Read Timeout configuration is as follows:
|
SSL Configuration. Specifies values to enable SSL client authentication that Microgateway uses to authenticate incoming requests for the native API. | |
Keystore Alias | Specifies the keystore alias that is present in the system-settings.yml. 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. |
Service Registry Configuration | |
Service Discovery Endpoint Parameter | Values required for constructing the
discovery service URI.
For example: if the service registry configuration of the service registry that you have selected in Endpoint URI has Service discovery path set to /catalog/service/{serviceName} (and the {serviceName} alias is intended for passing the service name), you must provide {serviceName} as Parameter and the name of the service as Value. |
Rule: Defines the routing decisions based on one of the following routing options. | |
Payload Identifier | Specifies using the payload identifier to
identify the client, extract the custom authentication credentials supplied in
the request represented using the payload identifier, and verify the client's
identity.
The Payload identifier includes the following information.
You can have multiple payload identifiers as required. Note: Only one payload identifier of each type is allowed.
For example, you can have a maximum of three payload identifiers, each being of
a different type.
|
Route To. Specifies the Endpoint URI of native APIs in a pool to which the requests are routed. | |
Endpoint URI | Specifies the URI of the native API endpoint to route the request to. You can use service registries in a similar manner as described in the main Endpoint URI above. |
HTTP Method |
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. |
HTTP Connection Timeout (seconds) | Specifies the time interval (in seconds)
after which a connection attempt times out.
The precedence of the Connection Timeout configuration is as follows:
|
Read Timeout (seconds) | Specifies the time interval (in seconds)
after which a socket read attempt times out.
The precedence of the Read Timeout configuration is as follows:
|
SSL Configuration | Specifies values to enable SSL client
authentication that
Microgateway
uses to authenticate incoming requests for the native API.
Provide the following information:
|
Service Registry Configuration | |
Service Discovery Endpoint Parameter | Values required for constructing the
discovery service URI.
For example: if the service registry configuration of the service registry that you have selected in Endpoint URI has Service discovery path set to /catalog/service/{serviceName} (and the {serviceName} alias is intended for passing the service name), you must provide {serviceName} as Parameter and the name of the service as Value. |