Why are some service registration controls in RegistrationParams and others in Registration #802
-
During the service registration process there are some properties that are part of the These need to be called before the service is registered: platform/service/pkg/serviceregistry/serviceregistry.go Lines 48 to 55 in 459e82a These need to be called after the service is registered and the RegistrationFunc is executed: platform/service/pkg/serviceregistry/serviceregistry.go Lines 35 to 36 in 459e82a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The lifecycle of a service looks like this flowchart TD
subgraph otdf [OpenTDF]
S --> REG
REG --> O_BOOT_S1
O_BOOT_S1 -- read service registrations --> O_BOOT_S1
O_BOOT_S1 ----> O_BOOT_S2
O_BOOT_S2 -- load config --> O_BOOT_S2
O_BOOT_S2 -- for each service --> IF_ENABLED{Is enabled in config?}
IF_ENABLED -->|Yes| IF_DB{Req DB?}
IF_ENABLED -->|No| SKIP
IF_DB -->|Yes| IF_DB_AUTOMIG{Config runMigration?}
IF_DB -->|No| O_WK
O_WK --> O_REDI
O_REDI --> E
subgraph db
direction LR
IF_DB_AUTOMIG -->|Yes| O_DB_MIG
IF_DB_AUTOMIG -->|No| O_WK
end
O_DB --> O_WK
end
subgraph user [User Setup]
U --> DFN
U --> REG
end
DFN[Define New Registration]
REG[Register Service]
O_BOOT_S1[Stage 1]
O_BOOT_S2[Stage 2]
O_REG[OpenTDF Register Service]
O_START[OpenTDF Start Service]
O_DB[Register Database]
O_DB_MIG[Run db migration]
O_WK[Define Wellknown Config]
O_REDI[Define Readiness Checks]
SKIP((Skip))
S((▶))
E((⏹))
There are times when services need to register prior to starting and other times when a service needs to run a routine after its started. |
Beta Was this translation helpful? Give feedback.
The lifecycle of a service looks like this