Configure service governance settings

Configure the following service governance settings to ensure service reliability:

Create a service downgrade rule

Create a service/application weight rule

Create a load balancing rule

Create a service/application forbid rule

Create a service downgrade rule

When a service provider does not respond to requests and is disabled, you can configure the service provider to return specific information to consumers or shield the requests.

baloom

This feature is applicable to services but not to applications.

 

Procedure

  1. On the top navigation bar, click Business Apps.

  1. From the left navigation pane, select Microservices > Microservices Engines.

  1. Click the name of an engine.

The upper area of the details page displays the basic information about the engine, including type, version, creation time, registration center address, configuration center address, and data source center address.

  1. Click the Governance tab.

  1. From the left navigation pane of the tab, select Service Downgrade, click Create Service Downgrade Rule, configure the parameters as needed, and then click OK.

Parameters

Parameter

Description

Service

Select a service.

Mock

Select either option:

  • Tolerate: The service provider does not process requests and returns the predefined value to consumers. For example, if service A calls service B and tolerance value return null is configured, null will be returned to service A when service B fails. This option is applicable to scenarios where a service provider returns specific error information to consumers when the service fails.

  • Shield: The service provider does not process requests and returns the specified text information to consumers. This option is applicable to scenarios where a service provider is shielded by the administrator and specific information is returned to consumers.

Return text

Specify the information to be returned to consumers, in return text format.

 

Create a service/application weight rule

Perform this task to configure weight values for service instances, so requests to the service will be distributed based on the weight settings.

You can click Services or Apps on the service weight configuration tab to configure weight rules for services or applications.

 

Procedure

  1. On the top navigation bar, click Business Apps.

  1. From the left navigation pane, select Microservices > Microservices Engines.

  1. Click the name of an engine.

The upper area of the details page displays the basic information about the engine, including type, version, creation time, registration center address, configuration center address, and data source center address.

  1. Click the Governance tab.

  1. From the left navigation pane of the tab, select Service Weight, click Create Service Weight Rule, configure the parameters as needed, and then click OK.

Parameters

Parameter

Description

Service/App

Select as service or application.

Service Provider

Select a service provider.

Weight

Specify the weight value in the range of 1 to 2147483647. The default weight is 100.

For example, if service B has two instances and both instances use the default weight value (100), requests to service B will be equally distributed to the two instances. If you set the weight value for one instance to 50, more requests will be distributed to the other instance.

 

Create a load balancing rule

Create a load balancing rule to balance the traffic load across the instances of a service. When an instance fails, the instance will be isolated temporarily to avoid request timeout.

You can click Services or Apps on the load balancing configuration tab to configure load balancing rules for services or applications.

 

Procedure

  1. On the top navigation bar, click Business Apps.

  1. From the left navigation pane, select Microservices > Microservices Engines.

  1. Click the name of an engine.

The upper area of the details page displays the basic information about the engine, including type, version, creation time, registration center address, configuration center address, and data source center address.

  1. Click the Governance tab.

  1. From the left navigation pane of the tab, select Load Balancing, click Create Load Balancing Rule, configure the parameters as needed, and then click OK.

Parameters

Parameter

Description

Service/App

Select a service or application.

Service Provider

Select a service provider.

Policy

Select a load balancing mode:

  • Random—Distributes requests to the service instances randomly.

  • Round—Distributes requests to the service instances in turn.

  • Least Active—Distributes requests to the least active service instance.

 

Create a service/application forbid rule

  • You can click Services or Apps on the service forbid configuration tab to configure service forbid rules for services or applications.

  • You cannot forbid all instances of a service. If you select all instances when creating a service forbid rule, the rule does not take effect.

 

  1. On the top navigation bar, click Business Apps.

  1. From the left navigation pane, select Microservices > Microservices Engines.

  1. Click the name of an engine.

The upper area of the details page displays the basic information about the engine, including type, version, creation time, registration center address, configuration center address, and data source center address.

  1. Click the Governance tab.

  1. From the left navigation pane of the tab, select Service Forbid, click Create Service Forbid Rule, configure the parameters as needed, and then click OK.