webMethods CloudStreams 10.3 | webMethods CloudStreams Documentation 10.3 | Virtual Services | Creating a New Virtual Service (REST) | The "In Sequence" Step (REST) | The "Routing Rule" Step (REST) | The "Context-Based" Routing Rule Step (REST)
 
The "Context-Based" Routing Rule Step (REST)
If you have a native service 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. A routing rule specifies where the requests should be routed, and the criteria by which they should be routed there. For example, requests can be routed according to certain consumers, certain dates/times, or according to requests that exceed/fall below a specified metric (Total Count, Success Count, Fault Count, etc.). You can create one or more rules. For example, you might use this capability to route requests from certain high-priority consumers to endpoints on a fast machine.
* To configure the "Routing Rule" step for "Context-Based" routing (REST)
*Open Software AG Designer and display the CloudStreams Development perspective by clicking Window > Open Perspective > Other > CloudStreams Development.
*In the CloudStreams Governance view, expand your CloudStreams Governance project and click the virtual service name.
*Expand In Sequence.
*Click Routing Rule and complete the following fields in the General page in the Properties view.
Option
Description
Name
You can optionally change the step name. There are no naming restrictions.
Type
(Read-only field.) Routing Rule.
Protocol
(Read-only field.) HTTP.
Routing Type
Select Context-Based.
Rule Name
Assign a name for the rule.
Then, click the icon next to this field and choose one of the following variables in the Configure Routing Rule dialog box that appears: Time, IP Address (IPv4 or IPv6 format), Date, Consumer, Predefined Context Variable or Custom Context Variable (see Using Context Variables in IS Services). Then specify a value and operator appropriate for your chosen variable. If you need to specify multiple variables, use the plus button at the end of the row to add rows.
Note: If you select the value Custom Context Variable, you must write an IS service to get/set the custom context variable, and then invoke that service in an Invoke IS Service step. CloudStreams provides an API to get/set custom context variables. For more information, see The API for Context Variables. CloudStreams automatically declares any custom context variables you have specified; there is no need for you to declare them.
Route To
Specify the URL of the native service to route the request to, if the rule criteria are met.
Then, click the icon next to this field and complete the Configure Endpoint Properties dialog box as follows:
*HTTP Properties
*Connection Timeout: The time interval (in seconds) after which a connection attempt will timeout. If a value is not specified (or if the value 0 is specified), CloudStreams will use the default value specified in Integration Server.
*Read Timeout: The time interval (in seconds) after which a socket read attempt will timeout. If a value is not specified (or if the value 0 is specified), the default is 30 seconds.
*SSL Options: Optional. To enable SSL client authentication for the endpoint, you must specify values for both the Client Certificate Alias field and the IS Keystore Alias field. If you specify a value for only one of these fields, a deployment error will occur. You may leave both fields blank.
*Client Certificate Alias: The client's private key to be used for performing SSL client authentication.
*IS Keystore Alias: The keystore alias of the instance of Integration Server on which CloudStreams is running. This value (along with the value of Client Certificate Alias) will be used for performing SSL client authentication.
HTTP Method
The HTTP method to pass to the rule.
Default To
Enter a native service endpoint to route the request to in case all routing rules evaluate to False. Then, click the icon next to this field and complete the Configure Endpoint Properties dialog box, as described for the Route To field above.
HTTP Method
The HTTP method to pass to the native service.
Typically you want to pass each request to the native service with the same HTTP method that is contained in the request. For example, if a request contains a GET method, you allow the GET method to be passed to the native service. In this case, select the value CUSTOM, which is a context variable that contains the HTTP method that is contained in the request.
However, in other cases you might want to change the HTTP method of a request to a different HTTP method. In this case, you can specify the different method explicitly (by selecting the GET, POST, PUT or DELETE value), or you can specify the different method dynamically on a per-request basis. If you want to specify the method dynamically, select the CUSTOM option and then write an IS service to set the value of the context variable. For more information, see Changing the HTTP Method of a REST Virtual Service.
Use credentials from incoming request
Default. Authenticates requests based on the credentials specified in the HTTP header. CloudStreams passes the Authorization header present in the original client request to the native service.
Use specific credentials
Authenticates requests according to the values you specify in the User, Password and Domain fields.
Invoke service anonymously
Does not authenticate requests.
Use existing HTTP Headers
Use the HTTP headers that are contained in the requests.
Customize HTTP Headers
Use the HTTP headers that you specify in the Name and Value columns on this page. If you need to specify multiple headers, use the plus button to add rows.

Copyright © 2013-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.