@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
|
@@ -27,13 +27,16 @@ const { assertLogger } = require('@onlineapps/logger-contract');
|
|
|
27
27
|
* Čtyři otázky (`change-discipline.md` § Removing something removes its
|
|
28
28
|
* declaration) jsou zodpovězené v CHANGELOGu dávky.
|
|
29
29
|
*
|
|
30
|
-
* `scope` tedy už o zakládání front
|
|
30
|
+
* `scope` tedy už o zakládání front nerozhodoval; od d.419 neříkal nic a od d.514
|
|
31
|
+
* tu není. Co rozhoduje o tvaru hlášení, je třída vlastnictví, kterou odpověděla
|
|
32
|
+
* CENTRÁLNÍ deklarace — `error.kind` z `QueueNotFoundError` — takže dva klienti
|
|
33
|
+
* namířené na tutéž frontu nemohou dostat různou odpověď podle toho, kdo je
|
|
34
|
+
* postavil. Čtyři otázky k odstranění jsou zodpovězené v CHANGELOGu dávky.
|
|
31
35
|
*/
|
|
32
36
|
class RecoveryWorker {
|
|
33
37
|
/**
|
|
34
38
|
* @param {Object} options
|
|
35
39
|
* @param {Object} options.client - RabbitMQClient instance
|
|
36
|
-
* @param {string} [options.scope='infrastructure'] - 'infrastructure' nebo 'business'
|
|
37
40
|
* @param {Object} options.logger - Logger s info/warn/error/debug (povinny)
|
|
38
41
|
*/
|
|
39
42
|
constructor(options = {}) {
|
|
@@ -45,7 +48,6 @@ class RecoveryWorker {
|
|
|
45
48
|
}
|
|
46
49
|
|
|
47
50
|
this._client = options.client;
|
|
48
|
-
this._scope = options.scope || 'infrastructure';
|
|
49
51
|
this._logger = assertLogger(
|
|
50
52
|
'RecoveryWorker',
|
|
51
53
|
options.logger,
|
|
@@ -98,9 +100,11 @@ class RecoveryWorker {
|
|
|
98
100
|
// with default arguments and no TTL. Refusing at one door while opening the
|
|
99
101
|
// other is not a guard.
|
|
100
102
|
//
|
|
101
|
-
// `
|
|
102
|
-
// never meant "may create business queues", and ConnectorMQClient
|
|
103
|
-
//
|
|
103
|
+
// `recoveryScope: 'business'` said the CLIENT belongs to a business service.
|
|
104
|
+
// It never meant "may create business queues", and `ConnectorMQClient` set it
|
|
105
|
+
// for every biz service, so that reading made the rule vacuous. The key is
|
|
106
|
+
// gone with the door it guarded (d.514); what decides here is `error.kind`,
|
|
107
|
+
// which the central declaration answers.
|
|
104
108
|
if (error.kind === 'business') {
|
|
105
109
|
this._logger.error(`[RecoveryWorker] Cannot create business queue '${error.queueName}' - it is created by its owning service via setupServiceQueues() after registration`);
|
|
106
110
|
throw error;
|