Arrangement of Namespace types in the distributed configuration center Apollo

Namespace type

There are three types of Namespace:
[1] Private type
[2] Public type
[3] Association type (inherited type)

(1) Private type

Private type Namespaces have private permissions. For example, the "application" Namespace mentioned above is a private type.
Insert image description here

(2) Public type

1 Introduction

Namespaces of public types have public permissions. The public namespace is equivalent to the configuration that is independent of the application, and the public namespace is identified by the name of the namespace, so the name of the public namespace must be globally unique.
Insert image description here

2.Usage scenarios

[1] Configuration shared at the department level
[2] Configuration shared at the group level
[3] Configuration shared between several projects
【4】Middleware client configuration

3.Example

I didn’t understand this feature at first. I mistakenly thought that if I wanted to directly call the different AppId project configurations of other project groups, I needed to configure the Apollo project configuration in the project. After further understanding, I found that Apollo's "public" type configuration can be obtained by any client, that is, it does not need to go through the corresponding AppId, but can be obtained directly through the following method.
ConfigService.getConfig("Configuration namespace of any public type");

(3) Association type

1.Meaning

Insert image description here
The associated type can also be called the inherited type, and the associated type has private permissions. The associated type Namespace inherits from the public type Namespace and is used to override certain configurations of the public Namespace. For example, a public Namespace has two configuration items
Insert image description here
and then Application A has a namespace of associated type that is associated with this public Namespace and overwrites the configuration item k1, and the new value is v3. Then when application A actually runs, the configuration of the public namespace obtained is:
Insert image description here

Guess you like

Origin blog.csdn.net/Octopus21/article/details/131294116