@ddd-ts-kit/kafka 0.113.1 → 0.114.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.fr.md CHANGED
@@ -1,5 +1,5 @@
1
1
  [English](README.md) · **Français**
2
- <!-- translation-of: README.md sha256:62021d366d69c70e -->
2
+ <!-- translation-of: README.md sha256:80626f5ce9b8665b -->
3
3
 
4
4
  # @ddd-ts-kit/kafka
5
5
 
@@ -67,7 +67,7 @@ donné à l'application sous la forme de deux ports du noyau : `IntegrationEvent
67
67
  l'outbox, et `EventSubscribers` remet à chaque contexte l'abonné de son propre nom de
68
68
  consommateur.
69
69
 
70
- ![Dans le contexte producteur, le gestionnaire de commande écrit la commande client et son événement dans l'outbox en une transaction ; l'OutboxRelay réclame l'enregistrement et le donne à KafkaEventBus.publish (producteur idempotent, acks=all), qui l'écrit dans le topic de son type, avec pour clé l'id de la commande ; chaque contexte consommateur est un groupe de consommateurs, notifications et billing reçoivent tous deux chaque événement, les deux instances de billing se partagent les partitions ; le gestionnaire de billing valide sa marque et son travail en une unité de travail avant que l'offset soit validé ; un enregistrement qui échoue encore et encore part dans le topic de rejet de billing](https://raw.githubusercontent.com/gbourgeat/ddd-ts-kit/main/docs/assets/diagrams/kafka-place-in-an-application.fr.svg)
70
+ ![Dans le contexte producteur, le gestionnaire de commande écrit la commande client et son événement dans l'outbox en une transaction ; l'OutboxRelay réclame l'enregistrement et le donne à KafkaEventBus.publish (producteur idempotent, acks=all), qui l'écrit dans le topic de son type, avec pour clé l'id de la commande ; chaque contexte consommateur est un groupe de consommateurs, notifications et billing reçoivent tous deux chaque événement, les deux instances de billing se partagent les partitions ; le gestionnaire de billing valide sa marque et son travail en une unité de travail avant que l'offset soit validé ; un enregistrement qui échoue encore et encore part dans le topic de rejet de billing](https://raw.githubusercontent.com/ddd-ts-kit/ddd-ts-kit/main/docs/assets/diagrams/kafka-place-in-an-application.fr.svg)
71
71
 
72
72
  `init --broker kafka` écrit ce câblage dans la plateforme du projet : le bus est construit par
73
73
  `platform/events/create-event-provider.ts`, avec la clé de `platform/events/aggregate-key-of.ts`,
@@ -289,7 +289,7 @@ Kafka ordonne les enregistrements d'une partition, et la clé choisit la partiti
289
289
  les dupliquer), un consommateur traite les enregistrements d'une partition un à la fois, et
290
290
  un enregistrement en échec est retenté **sur place**, voir plus bas.
291
291
 
292
- ![Deux événements de la commande 1, placée puis payée : avec la clé par défaut, l'id de l'événement, ils tombent sur deux partitions possédées par deux instances, et payée peut être traitée avant placée ; avec keyOf qui donne l'id de la commande, les deux tombent sur une partition possédée par une seule instance et sont traités dans l'ordre du journal](https://raw.githubusercontent.com/gbourgeat/ddd-ts-kit/main/docs/assets/diagrams/kafka-keys-and-partitions.fr.svg)
292
+ ![Deux événements de la commande 1, placée puis payée : avec la clé par défaut, l'id de l'événement, ils tombent sur deux partitions possédées par deux instances, et payée peut être traitée avant placée ; avec keyOf qui donne l'id de la commande, les deux tombent sur une partition possédée par une seule instance et sont traités dans l'ordre du journal](https://raw.githubusercontent.com/ddd-ts-kit/ddd-ts-kit/main/docs/assets/diagrams/kafka-keys-and-partitions.fr.svg)
293
293
 
294
294
  <!-- checked sample -->
295
295
  ```ts
@@ -359,7 +359,7 @@ sont traités sans lui, et un rejeu le ramène en retard. Un consommateur qui ne
359
359
  tolérer doit s'arrêter lui-même sur le rejet (porter une version dans la charge utile, refuser
360
360
  un trou).
361
361
 
362
- ![Deux enregistrements de la commande 1 sur une partition, placée puis payée : avec un topic de nouvelles tentatives, l'enregistrement placée en échec est mis de côté, payée est traitée, et placée plus tard, si bien que payée est appliquée avant placée ; avec la nouvelle tentative sur place de ce bus, la partition est mise en pause pendant retry.delayMs tandis que les autres partitions continuent, placée est relue et traitée, puis payée ; après retry.maxAttempts livraisons en échec, l'enregistrement part dans le topic de rejet et la partition avance](https://raw.githubusercontent.com/gbourgeat/ddd-ts-kit/main/docs/assets/diagrams/kafka-retry-in-place.fr.svg)
362
+ ![Deux enregistrements de la commande 1 sur une partition, placée puis payée : avec un topic de nouvelles tentatives, l'enregistrement placée en échec est mis de côté, payée est traitée, et placée plus tard, si bien que payée est appliquée avant placée ; avec la nouvelle tentative sur place de ce bus, la partition est mise en pause pendant retry.delayMs tandis que les autres partitions continuent, placée est relue et traitée, puis payée ; après retry.maxAttempts livraisons en échec, l'enregistrement part dans le topic de rejet et la partition avance](https://raw.githubusercontent.com/ddd-ts-kit/ddd-ts-kit/main/docs/assets/diagrams/kafka-retry-in-place.fr.svg)
363
363
 
364
364
  Le bus décide d'après ce que fait le gestionnaire : un gestionnaire qui cache son échec le cache
365
365
  aussi au bus.
package/README.md CHANGED
@@ -61,7 +61,7 @@ each consuming context listens through the bus under its own name. The bus is gi
61
61
  application as two ports of the kernel: `IntegrationEventPublisher` stays the outbox, and
62
62
  `EventSubscribers` hands each context the subscriber of its own consumer name.
63
63
 
64
- ![In the producing context the command handler writes the order and its event to the outbox in one transaction; the OutboxRelay claims the record and gives it to KafkaEventBus.publish (idempotent producer, acks=all), which writes it to the topic of its type, keyed by the order id; each consuming context is a consumer group, notifications and billing both receive every event, the two instances of billing share the partitions; the billing handler commits its mark and its work in one unit of work before the offset is committed; a record that keeps failing goes to the dead-letter topic of billing](https://raw.githubusercontent.com/gbourgeat/ddd-ts-kit/main/docs/assets/diagrams/kafka-place-in-an-application.svg)
64
+ ![In the producing context the command handler writes the order and its event to the outbox in one transaction; the OutboxRelay claims the record and gives it to KafkaEventBus.publish (idempotent producer, acks=all), which writes it to the topic of its type, keyed by the order id; each consuming context is a consumer group, notifications and billing both receive every event, the two instances of billing share the partitions; the billing handler commits its mark and its work in one unit of work before the offset is committed; a record that keeps failing goes to the dead-letter topic of billing](https://raw.githubusercontent.com/ddd-ts-kit/ddd-ts-kit/main/docs/assets/diagrams/kafka-place-in-an-application.svg)
65
65
 
66
66
  `init --broker kafka` writes this wiring in the platform of the project: the bus is built by
67
67
  `platform/events/create-event-provider.ts`, keyed by `platform/events/aggregate-key-of.ts`,
@@ -280,7 +280,7 @@ Kafka orders the records of one partition, and the key chooses the partition. So
280
280
  consumer handles the records of a partition one at a time, and a failed record is retried
281
281
  **in place**, see below.
282
282
 
283
- ![Two events of order 1, placed then paid: with the default key, the event id, they land on two partitions owned by two instances and paid may be handled before placed; with keyOf giving the order id, both land on one partition owned by one instance and are handled in the order of the log](https://raw.githubusercontent.com/gbourgeat/ddd-ts-kit/main/docs/assets/diagrams/kafka-keys-and-partitions.svg)
283
+ ![Two events of order 1, placed then paid: with the default key, the event id, they land on two partitions owned by two instances and paid may be handled before placed; with keyOf giving the order id, both land on one partition owned by one instance and are handled in the order of the log](https://raw.githubusercontent.com/ddd-ts-kit/ddd-ts-kit/main/docs/assets/diagrams/kafka-keys-and-partitions.svg)
284
284
 
285
285
  <!-- checked sample -->
286
286
  ```ts
@@ -346,7 +346,7 @@ that follow a dead one are handled without it, and a replay brings it back late.
346
346
  that cannot tolerate that must stop on the dead letter itself (carry a version in the
347
347
  payload, refuse a gap).
348
348
 
349
- ![Two records of order 1 on one partition, placed then paid: with a retry topic, the failed placed record is moved aside, paid is handled, and placed later, so paid is applied before placed; with the retry in place of this bus, the partition is paused for retry.delayMs while the other partitions keep flowing, placed is read again and handled, then paid; after retry.maxAttempts failed deliveries the record goes to the dead-letter topic and the partition moves on](https://raw.githubusercontent.com/gbourgeat/ddd-ts-kit/main/docs/assets/diagrams/kafka-retry-in-place.svg)
349
+ ![Two records of order 1 on one partition, placed then paid: with a retry topic, the failed placed record is moved aside, paid is handled, and placed later, so paid is applied before placed; with the retry in place of this bus, the partition is paused for retry.delayMs while the other partitions keep flowing, placed is read again and handled, then paid; after retry.maxAttempts failed deliveries the record goes to the dead-letter topic and the partition moves on](https://raw.githubusercontent.com/ddd-ts-kit/ddd-ts-kit/main/docs/assets/diagrams/kafka-retry-in-place.svg)
350
350
 
351
351
  The bus decides from what the handler does, so a handler that hides its failure hides it from
352
352
  the bus too:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ddd-ts-kit/kafka",
3
- "version": "0.113.1",
3
+ "version": "0.114.1",
4
4
  "description": "Kafka provider for integration events: idempotent keyed publishing for the outbox relay, one consumer group per consumer, offsets committed after handling, bounded retries and a dead-letter topic.",
5
5
  "keywords": [
6
6
  "ddd",
@@ -17,11 +17,11 @@
17
17
  "license": "MIT",
18
18
  "repository": {
19
19
  "type": "git",
20
- "url": "git+https://github.com/gbourgeat/ddd-ts-kit.git",
20
+ "url": "git+https://github.com/ddd-ts-kit/ddd-ts-kit.git",
21
21
  "directory": "packages/kafka"
22
22
  },
23
- "homepage": "https://gbourgeat.github.io/ddd-ts-kit/packages/kafka/",
24
- "bugs": "https://github.com/gbourgeat/ddd-ts-kit/issues",
23
+ "homepage": "https://ddd-ts-kit.github.io/ddd-ts-kit/packages/kafka/",
24
+ "bugs": "https://github.com/ddd-ts-kit/ddd-ts-kit/issues",
25
25
  "publishConfig": {
26
26
  "access": "public",
27
27
  "provenance": true
@@ -41,12 +41,12 @@
41
41
  "dist"
42
42
  ],
43
43
  "dependencies": {
44
- "@ddd-ts-kit/events": "0.113.1",
45
- "@ddd-ts-kit/kernel": "0.113.1"
44
+ "@ddd-ts-kit/events": "0.114.1",
45
+ "@ddd-ts-kit/kernel": "0.114.1"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@confluentinc/kafka-javascript": "^1.11.0",
49
- "@ddd-ts-kit/testing": "0.113.1"
49
+ "@ddd-ts-kit/testing": "0.114.1"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@confluentinc/kafka-javascript": ">=1.11.0 <2"