Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When multiple instances of the consumer modules are deployed, the same consumer group should be set for all of them.

Domain events json schema

Module sends notifications, when there is any change of domain entities (e.g. instance, holding, item, loans).

The pattern means that every time when an entity is created/updated/removed a message is posted to Kafka topic:

The event payload should have the following structure:

{
  "old": {...}, // the entity state before update or delete
  "new": {...}, // the entity state update or create
  "type": "UPDATE|DELETE|CREATE|DELETE_ALL", // type of the event
  "tenant": "diku" // tenant nameid
}

X-Okapi-Url and X-Okapi-Tenant headers could be set from the request to the Kafka message.


Domain events for delete all APIs

In order to clean data for some tenant. There could be delete all APIs for records. For such APIs we're issuing a special domain event:

  • Partition key: 00000000-0000-0000-0000-000000000000
  • Event payload:
{
  "type": "DELETE_ALL",
  "tenant": "<the tenant name>"
}