3.2. Runtime Governance Managed Applications

3.2.1. Building a Runtime Governance Managed Application

When you deploy and use a SwitchYard application out-of-the-box, the activity information is reported and stored to the Runtime Governance Activity Server, provided activity collection is enabled. Additionally, the activity events are submitted to the out-of-the-box event processor networks (EPNs). The event processor networks then derive some default information, such as response time data and service dependency information. This information is available through the gadgets in the Runtime Governance user interface.

Procedure 3.1. To build a Runtime Governance managed application:

  1. Deploy your SwitchYard application and enable Runtime Governance activity collection.
  2. To record any additional context (correlation) or properties with the activity information, define an Information Processor with the configuration details required to extract the information.
  3. To enforce policy decisions immediately (synchronously), define:
    1. An activity validator to contact the policy you wish to enforce.
    2. An interceptor in the SwitchYard application to trigger the validation.
    Note
    Activity Validators are only intended to validate the activities and raise exceptions where necessary to block the business transaction.
  4. If policy decisions can be processed asynchronously, define an Event Processor Network which executes in the server.
    Note
    You can use the Event Processor Networks to derive further information (including Situations), enabling creation of multiple networks or nodes and building on previously processed information.
This section outlines a basic flow of building and customizing your Runtime Governance managed application. More details on event collection and processing are discussed later in this chapter.

3.2.2. Customizing Your Runtime Governance Managed Application

This section discusses how you can further enhance your Runtime Governance managed application. You can implement one or more of these basic flows, depending on the type of Runtime Governance you are interested in:

Create rules or policies based on general interaction information or response times

Based on the out-of-the-box configuration, you have an option to define your own Event Processor Networks (EPN). You can use your EPNs to observe the basic activity information or derived response times to perform required actions (such as deriving further information, and identifying situations to create an alert). For more information, refer the policy-async quickstart.

Create server side (asynchronous) policies based on business specific information

To define intelligent policies, it is necessary to extract information from the message content or headers. This requires the definition of an Information Processor to define how each message type should be processed to extract the relevant context and property information. For more information, refer the order management quickstart with an ip artifact defining the information processor for the order management application.

Note
Creating the ip and EPN modules associated with the SwitchYard application is useful as there may be different users developing the SwitchYard application and defining the governance aspects. Once the relevant information is extracted and associated with the activity events, the server side EPNs can access this information to perform more intelligent tasks, such as assess a customer's credit limit. For more information, refer the policy-async quickstarts.

Create client side (synchronous) activity validators

Activity validators are similar to EPNs, except that they operate in the SwitchYard environment, and can be used to block business transactions based on evaluation of a business policy. As the SwitchYard event collection is asynchronous, blocking a business transaction can only be achieved by performing the activity validation from within the SwitchYard application, with the use of an interceptor. For more information, refer the ordermgmt/app quickstart and the policy-sync quickstart, which defines the validator policy.

Note
Creation of an Information Processor configuration is optional. You can use it to extract additional relevant information that may be required by the activity validator policies.