@onlineapps/mq-client-core 3.2.0 → 4.0.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/CHANGELOG.md +368 -0
- package/README.md +77 -6
- package/package.json +2 -2
- package/src/BaseClient.js +65 -4
- package/src/config/configSchema.js +7 -14
- package/src/config/defaultConfig.js +3 -7
- package/src/config/queueConfig.js +22 -2
- package/src/transports/rabbitmqClient.js +462 -77
- package/src/workers/RecoveryWorker.js +10 -6
|
@@ -387,22 +387,15 @@ module.exports = {
|
|
|
387
387
|
},
|
|
388
388
|
|
|
389
389
|
// ---------------------------------------------------------------------
|
|
390
|
-
//
|
|
391
|
-
// `
|
|
392
|
-
//
|
|
393
|
-
// being from a declaration or not at all
|
|
390
|
+
// `queueCreationFilter` and `queueCreationCallback` stood here until d.419,
|
|
391
|
+
// and `recoveryScope` — the permission they were filtered by — until d.514.
|
|
392
|
+
// They were how a client declared a queue nobody owns, and a queue now comes
|
|
393
|
+
// into being from a declaration or not at all
|
|
394
394
|
// (`docs/governance/confirmations/mq-consumer-contract.md` 006). A config
|
|
395
|
-
// still carrying
|
|
396
|
-
// CLOSED, which is what makes the removal visible to the caller
|
|
397
|
-
// silently ignored.
|
|
395
|
+
// still carrying any of the three is refused by name at construction — the
|
|
396
|
+
// schema is CLOSED, which is what makes the removal visible to the caller
|
|
397
|
+
// instead of silently ignored.
|
|
398
398
|
// ---------------------------------------------------------------------
|
|
399
|
-
recoveryScope: {
|
|
400
|
-
type: 'string',
|
|
401
|
-
enum: ['infrastructure', 'business'],
|
|
402
|
-
description:
|
|
403
|
-
'Which kind of service this client belongs to. It decides nothing about queue '
|
|
404
|
-
+ 'creation: no client declares a queue (workers/RecoveryWorker.js).',
|
|
405
|
-
},
|
|
406
399
|
},
|
|
407
400
|
required: ['type', 'host'], // Only type and host required
|
|
408
401
|
|
|
@@ -186,11 +186,7 @@ module.exports = {
|
|
|
186
186
|
criticalHealthShutdown: true,
|
|
187
187
|
criticalHealthShutdownDelay: 60000,
|
|
188
188
|
|
|
189
|
-
//
|
|
190
|
-
//
|
|
191
|
-
//
|
|
192
|
-
// used to let it — `queueCreationFilter` and `queueCreationCallback` — left
|
|
193
|
-
// with that door (d.419, conf mq-consumer-contract 006).
|
|
194
|
-
// ---------------------------------------------------------------------
|
|
195
|
-
recoveryScope: 'infrastructure',
|
|
189
|
+
// `recoveryScope` stood here until d.514, with the two callbacks it filtered
|
|
190
|
+
// (`queueCreationFilter`, `queueCreationCallback`, d.419) one batch ahead of
|
|
191
|
+
// it. This client declares no queue at all, so there is no permission to give.
|
|
196
192
|
};
|
|
@@ -648,7 +648,10 @@ module.exports = {
|
|
|
648
648
|
* InfrastructureHealthTracker publishes service status changes
|
|
649
649
|
* Message format includes event_type: 'service.registered' | 'service.validation.completed' |
|
|
650
650
|
* 'service.version.changed' | 'service.deregistered' | 'service.status.changed'
|
|
651
|
-
* NOTE: Heartbeats are NOT published here
|
|
651
|
+
* NOTE: Heartbeats are NOT published here - they are too frequent. The cadence
|
|
652
|
+
* is not a number this file owns: see the `heartbeatInterval` constructor option
|
|
653
|
+
* of RegistryClient (@onlineapps/conn-orch-registry), which ServiceWrapper feeds
|
|
654
|
+
* from BIZ_HEARTBEAT_INTERVAL_MS.
|
|
652
655
|
* NOTE: Healthcheck messages go to infrastructure.health.events exchange
|
|
653
656
|
*/
|
|
654
657
|
'services': {
|
|
@@ -715,6 +718,17 @@ module.exports = {
|
|
|
715
718
|
* onward route — because the operator's dashboard matches `*.dlq` and a message
|
|
716
719
|
* that expired there is a message nobody got to decide about (confirmation
|
|
717
720
|
* `mq-consumer-contract` 002 point 2, 003 point 1).
|
|
721
|
+
*
|
|
722
|
+
* **A declaration is not a creation instruction. The terminal is brought into being
|
|
723
|
+
* by the owner of the prefix that NAMES it.** `initInfrastructureQueues()` derives
|
|
724
|
+
* the whole list from these sections only when its caller passes no `queues` list;
|
|
725
|
+
* every caller passes one, and the gateway's names exactly the five `workflow.*`
|
|
726
|
+
* queues it owns (`infra/api_gateway/index.js`). `monitoring.dlq` therefore belongs
|
|
727
|
+
* to the monitoring service's own call, beside the queues it consumes. Until that
|
|
728
|
+
* call names it, a `nack(requeue=false)` on a queue of this family dead-letters onto
|
|
729
|
+
* a routing key no queue carries and the broker DROPS the message — measured
|
|
730
|
+
* 2026-09-16 on the dev broker: 78 queues, and the only `.dlq` among them
|
|
731
|
+
* `workflow.dlq` and `delivery.dlq`.
|
|
718
732
|
*/
|
|
719
733
|
dlq: {
|
|
720
734
|
durable: true,
|
|
@@ -784,6 +798,10 @@ module.exports = {
|
|
|
784
798
|
* `workflow.dlq`, `delivery.dlq` and `monitoring.dlq` — durable, capped at 50k, no
|
|
785
799
|
* TTL, no onward route. A telemetry record the intake cannot process is the one an
|
|
786
800
|
* operator most needs to look at, and a TTL here would delete it before they did.
|
|
801
|
+
*
|
|
802
|
+
* Brought into being by the owner of the `telemetry.` prefix, the same rule as
|
|
803
|
+
* `monitoring.dlq` above: declared here, created by the service whose
|
|
804
|
+
* `initInfrastructureQueues()` call names it.
|
|
787
805
|
*/
|
|
788
806
|
dlq: {
|
|
789
807
|
durable: true,
|
|
@@ -891,7 +909,9 @@ module.exports = {
|
|
|
891
909
|
* CRITICAL: This is the ONLY queue used for service-to-Registry communication.
|
|
892
910
|
* Registry listener processes different message types based on msg.type:
|
|
893
911
|
* - type: 'register' - Service registration requests (full spec + operations)
|
|
894
|
-
* - type: 'heartbeat' - Periodic health check messages (
|
|
912
|
+
* - type: 'heartbeat' - Periodic health check messages (cadence owned by the
|
|
913
|
+
* `heartbeatInterval` constructor option of RegistryClient,
|
|
914
|
+
* @onlineapps/conn-orch-registry - not declared here)
|
|
895
915
|
* - type: 'deregister' - Voluntary shutdown notice
|
|
896
916
|
* (The legacy 'apiDescription' / 'apiDescriptionRequest' types are no
|
|
897
917
|
* longer supported — see operations-registry-contract.md §2.)
|