Skip to main content
Version: V2-Next

Topic Configuration

Configuration event topics​

A configuration event topic starts with the reverse domain prefix de.civitascore. The domain, the entity and the event follow. ADR 041 defines this convention and replaces the first convention from ADR 021.

de.civitascore.<domain>.<entity>.<event>
SegmentDescriptionExamples
de.civitascoreThe fixed platform prefix—
<domain>The platform domain, lowercaseidm, api, data
<entity>The platform entity, lowercase, no separatoruser, realm, backend, route, project
<event>The event type, past tensecreated, updated, deleted

A dot separates the segments. Kafka limits a topic name to 249 characters.

Every configuration event is a confirmation. The name is therefore in the past tense: the change has already occurred. There is no command topic in this namespace.

Identity management, idm​

EntityEvents
usercreated, updated, deleted, locked, unlocked, password.changed, password.reset
realmcreated, updated, deleted
clientcreated, updated, deleted
groupcreated, updated, deleted
rolecreated, updated, deleted
de.civitascore.idm.user.created
de.civitascore.idm.user.password.changed
de.civitascore.idm.realm.created
de.civitascore.idm.group.deleted

API management, api​

EntityEvents
backendcreated, updated, deleted
routecreated, updated, deleted
de.civitascore.api.backend.created
de.civitascore.api.route.updated

Data management, data​

EntityEvents
thingcreated, updated, deleted
locationcreated, updated, deleted
sensorcreated, updated, deleted
observedpropertycreated, updated, deleted
datastreamcreated, updated, deleted
projectcreated, updated, deleted
pipelinecreated, updated, deleted
de.civitascore.data.thing.created
de.civitascore.data.datastream.updated
de.civitascore.data.pipeline.deleted

A new event​

To add an event, do these four steps:

  1. Select the domain: idm, api, data, or a new abbreviation.
  2. Give the entity a name. Use lowercase and no separator.
  3. Write the event type in the past tense.
  4. For a composite event, separate the parts with a dot, for example password.changed.

Saga topics​

The orchestrator uses two topics. Both use the same de.civitascore prefix as the configuration events.

TopicPublisherSubscriberPurpose
de.civitascore.dataset.saga.triggerPortal backendOrchestratorStart a saga for a Dataset
de.civitascore.saga.resultOrchestratorPortal backendReport SAGA_COMPLETED or SAGA_FAILED

The orchestrator does not send a command to an adapter over Kafka. It calls the adapter handler directly in the process. Saga pattern describes the mechanism.

Payload data topics​

Planned

This namespace is not yet built. The Architecture Board has not reviewed it.

Payload data uses a topic namespace of its own. An installation selects one of two strategies.

Preferred: the domain of the customer. The reverse domain name of the customer is the prefix. This shows the owner and prevents a collision between installations.

<customer-domain>.<bundle>.<context>.<message-type>

de.musterstadt.umwelt.luftqualitaet.raw
de.musterstadt.verkehr.zaehlstellen.raw
ch.beispielgemeinde.energie.zaehler.validated

The installation sets the domain of the customer.

Fallback: the platform namespace. If there is no domain of the customer, the prefix de.civitascore.data applies.

de.civitascore.data.<bundle>.<context>.<message-type>

de.civitascore.data.umwelt.luftqualitaet.enriched
ScenarioNamespace
A dedicated installation with a known domainThe domain of the customer
A shared, staging or development environmentThe platform namespace

Payload structure​

A payload is JSON. It holds only the data that the operation needs. There is no generic wrapper, because the topic already gives the context.

Example for de.civitascore.idm.user.created:

{
"firstname": "Max",
"lastname": "Mustermann",
"email": "max.mustermann@civitas-stg.de"
}

The CloudEvents envelope holds the metadata. Kafka carries the envelope in the message headers.

Access control​

warning

Topic access control is not yet active. The installed Kafka cluster has no authentication on its listeners and no ACL, and it creates a topic automatically on first use.

The target model applies least privilege:

  • A component gets read or write access only on the topics that it needs.
  • A Kafka ACL enforces the access per topic.
  • The namespace prefix makes a wildcard rule possible for a whole category.

ADR 043 selects SASL/SCRAM-SHA-512 as the authentication mechanism.