@ddd-ts-kit/rabbitmq 0.83.3 → 0.84.0

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.
Files changed (3) hide show
  1. package/README.fr.md +12 -8
  2. package/README.md +10 -6
  3. package/package.json +4 -4
package/README.fr.md CHANGED
@@ -1,5 +1,5 @@
1
1
  [English](README.md) · **Français**
2
- <!-- translation-of: README.md sha256:1f7d369470f657a0 -->
2
+ <!-- translation-of: README.md sha256:c47420de486f4b8c -->
3
3
 
4
4
  # @ddd-ts-kit/rabbitmq
5
5
 
@@ -29,7 +29,7 @@ consommateur.
29
29
  ![Le gestionnaire de ordering écrit la commande client et un enregistrement d'outbox dans une seule transaction ; le relais de l'outbox donne l'enregistrement à RabbitMqEventBus, qui le publie sur l'exchange topic integration-events avec le type d'événement comme clé de routage et attend la confirmation du broker ; l'exchange route une copie vers la file de travail de chaque consommateur lié pour ce type, billing.ordering.order.placed et shipping.ordering.order.placed ; chaque file la remet aux gestionnaires de son contexte, acquittée après la validation de leur unité de travail](https://raw.githubusercontent.com/gbourgeat/ddd-ts-kit/main/docs/assets/diagrams/rabbitmq-outbox-to-queues.fr.svg)
30
30
 
31
31
  `init --broker rabbitmq` écrit ce câblage dans la plateforme du projet : le bus est construit par
32
- `platform/events/create-event-provider.ts`, `platform/platform.module.ts` lie à nouveau
32
+ `platform/events/create-event-provider.ts`, `platform/composition/platform.module.ts` lie à nouveau
33
33
  (`rebind`) `EventSubscribers` sur lui, et `main.ts` le donne, tracé, au relais de l'outbox. À la
34
34
  main, la même chose s'écrit :
35
35
 
@@ -369,9 +369,13 @@ ces *packages* le font, et esquisse SQS/SNS, qui n'est pas construit.
369
369
 
370
370
  ## Tests
371
371
 
372
- Le codec de l'enveloppe, les réglages et leurs valeurs par défaut, la description de la
373
- topologie et les codes d'échec sont couverts sans *broker*, par les tests unitaires. Les autres
374
- suites ont besoin d'un vrai *broker* et sont ignorées sans `DDD_TS_KIT_TEST_AMQP_URL` :
372
+ Toutes les suites tournent dans les tests unitaires, sans serveur : le bus se connecte à un
373
+ *broker* AMQP tenu en mémoire (`test/support/amqp/`), qui implémente les interfaces d'amqplib et
374
+ garde ce dont le bus dépend (*exchanges* topic et celui par défaut, arguments de *dead-letter*,
375
+ `x-message-ttl`, confirmations et retours de publication, *prefetch*, nouvelle livraison de ce
376
+ qu'un canal fermé n'avait pas acquitté, refus 406 et 404). Avec `DDD_TS_KIT_TEST_AMQP_URL`, les
377
+ mêmes suites tournent une seconde fois contre un vrai *broker*, ce qui garde celui en mémoire
378
+ fidèle :
375
379
 
376
380
  ```
377
381
  docker run -d --rm --name ddd-ts-kit-test-rabbitmq -e RABBITMQ_DEFAULT_USER=kit -e RABBITMQ_DEFAULT_PASS=kit -p 127.0.0.1:5672:5672 rabbitmq:4-management-alpine
@@ -379,11 +383,11 @@ DDD_TS_KIT_TEST_AMQP_URL=amqp://kit:kit@127.0.0.1:5672 npx vitest run packages/r
379
383
  docker rm -f ddd-ts-kit-test-rabbitmq
380
384
  ```
381
385
 
382
- Le *job* d'intégration de la CI les exécute sur chaque *pull request* qui atteint ce *package*,
386
+ Le *job* d'intégration de la CI les exécute contre un vrai *broker* sur chaque *pull request* qui atteint ce *package*,
383
387
  contre RabbitMQ 4.3.6 que démarre `pipeline/github/scripts/start-rabbitmq.sh`, son image épinglée par *digest*.
384
388
 
385
389
  Elles exécutent la suite de contrat sur des files quorum et sur des files classiques, puis les
386
390
  comportements de ce fournisseur, une suite par comportement (`publishing`, `consuming`,
387
- `correlation`, `retries`, `dead-letters`, `topology`, `connection-loss` à travers un relais TCP
388
- que le test coupe, `closing`), et toute la chaîne de l'outbox jusqu'à un consommateur idempotent.
391
+ `correlation`, `retries`, `dead-letters`, `topology`, `connection-loss` à travers un réseau que
392
+ le test coupe, un relais TCP devant un vrai *broker*, `closing`), et toute la chaîne de l'outbox jusqu'à un consommateur idempotent.
389
393
  Chaque test travaille sur un *exchange* et des files qui lui sont propres, et les supprime.
package/README.md CHANGED
@@ -25,7 +25,7 @@ application as two ports of the kernel: `IntegrationEventPublisher` stays the ou
25
25
  ![The handler of ordering writes the order and an outbox record in one transaction; the outbox relay gives the record to RabbitMqEventBus, which publishes it to the topic exchange integration-events with the event type as routing key and waits for the confirmation of the broker; the exchange routes a copy to the work queue of each consumer bound for that type, billing.ordering.order.placed and shipping.ordering.order.placed; each queue hands it to the handlers of its context, acknowledged after their unit of work committed](https://raw.githubusercontent.com/gbourgeat/ddd-ts-kit/main/docs/assets/diagrams/rabbitmq-outbox-to-queues.svg)
26
26
 
27
27
  `init --broker rabbitmq` writes this wiring in the platform of the project: the bus is built by
28
- `platform/events/create-event-provider.ts`, `platform/platform.module.ts` rebinds
28
+ `platform/events/create-event-provider.ts`, `platform/composition/platform.module.ts` rebinds
29
29
  `EventSubscribers` on it, and `main.ts` gives it, traced, to the outbox relay. By hand, the
30
30
  same thing reads:
31
31
 
@@ -354,9 +354,12 @@ and outlines SQS/SNS, which is not built.
354
354
 
355
355
  ## Testing
356
356
 
357
- The codec of the envelope, the settings and their defaults, the topology description and the
358
- failure codes are covered without a broker, in the unit run. The other suites need a real
359
- broker and are skipped without `DDD_TS_KIT_TEST_AMQP_URL`:
357
+ Every suite runs in the unit run, without a server: the bus connects to an AMQP broker held in
358
+ memory (`test/support/amqp/`), which implements the interfaces of amqplib and keeps what the bus
359
+ relies on (topic exchanges and the default one, dead-letter arguments, `x-message-ttl`, publisher
360
+ confirms and returns, prefetch, redelivery of what a closed channel had not acknowledged, 406 and
361
+ 404 refusals). With `DDD_TS_KIT_TEST_AMQP_URL`, the same suites run a second time against a real
362
+ broker, which is what keeps the in-memory one honest:
360
363
 
361
364
  ```
362
365
  docker run -d --rm --name ddd-ts-kit-test-rabbitmq -e RABBITMQ_DEFAULT_USER=kit -e RABBITMQ_DEFAULT_PASS=kit -p 127.0.0.1:5672:5672 rabbitmq:4-management-alpine
@@ -364,11 +367,12 @@ DDD_TS_KIT_TEST_AMQP_URL=amqp://kit:kit@127.0.0.1:5672 npx vitest run packages/r
364
367
  docker rm -f ddd-ts-kit-test-rabbitmq
365
368
  ```
366
369
 
367
- The integration job of the CI runs them on every pull request that reaches this package,
370
+ The integration job of the CI runs them against a real broker on every pull request that reaches this package,
368
371
  against RabbitMQ 4.3.6 that `pipeline/github/scripts/start-rabbitmq.sh` starts, its image pinned by digest.
369
372
 
370
373
  They run the contract suite on quorum and on classic queues, then the behaviours of this
371
374
  provider, one suite per behaviour (`publishing`, `consuming`, `correlation`, `retries`,
372
- `dead-letters`, `topology`, `connection-loss` through a TCP relay the test cuts, `closing`)
375
+ `dead-letters`, `topology`, `connection-loss` through a network the test cuts, a TCP relay in
376
+ front of a real broker, `closing`)
373
377
  and the whole chain from the outbox to an idempotent consumer. Every test works on an exchange and queues of its
374
378
  own and deletes them.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ddd-ts-kit/rabbitmq",
3
- "version": "0.83.3",
3
+ "version": "0.84.0",
4
4
  "description": "RabbitMQ provider for integration events: confirmed publishing for the outbox relay, durable queue per consumer, manual acknowledgement, bounded retries and dead-lettering.",
5
5
  "keywords": [
6
6
  "ddd",
@@ -38,14 +38,14 @@
38
38
  "dist"
39
39
  ],
40
40
  "dependencies": {
41
- "@ddd-ts-kit/kernel": "0.83.3",
42
- "@ddd-ts-kit/events": "0.83.3"
41
+ "@ddd-ts-kit/kernel": "0.84.0",
42
+ "@ddd-ts-kit/events": "0.84.0"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "amqplib": ">=0.10.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "amqplib": "latest",
49
- "@ddd-ts-kit/testing": "0.83.3"
49
+ "@ddd-ts-kit/testing": "0.84.0"
50
50
  }
51
51
  }