@autofleet/rabbit 3.0.1-alpha9 → 3.0.1-beta
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/dist/index.js +7 -1
- package/package.json +2 -2
- package/src/index.ts +6 -1
package/dist/index.js
CHANGED
|
@@ -338,12 +338,18 @@ class RabbitMq {
|
|
|
338
338
|
}
|
|
339
339
|
const traceId = msg.properties.headers[consts_1.TRACING_HEADER];
|
|
340
340
|
const userId = msg.properties.headers[consts_1.USER_TRACING_HEADER];
|
|
341
|
+
logger_1.default.info('rabbit: consume', { traceId, userId, enableRabbitTrace });
|
|
341
342
|
if (traceId) {
|
|
342
343
|
const trace = zehut_1.newTrace(zehut_1.traceTypes.RABBIT);
|
|
343
344
|
trace?.context?.set(consts_1.TRACING_HEADER, traceId);
|
|
344
345
|
}
|
|
345
346
|
else if (userId && enableRabbitTrace) {
|
|
346
|
-
|
|
347
|
+
try {
|
|
348
|
+
await zehut_1.setRabbitTrace(userId);
|
|
349
|
+
}
|
|
350
|
+
catch (e) {
|
|
351
|
+
logger_1.default.error('rabbit: failed to setRabbitTrace', { userId, e });
|
|
352
|
+
}
|
|
347
353
|
}
|
|
348
354
|
if (auditContext) {
|
|
349
355
|
auditContext(queue);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autofleet/rabbit",
|
|
3
|
-
"version": "3.0.1-
|
|
3
|
+
"version": "3.0.1-beta",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@autofleet/logger": "^1.2.8",
|
|
19
|
-
"@autofleet/zehut": "^3.0.1-
|
|
19
|
+
"@autofleet/zehut": "^3.0.1-beta",
|
|
20
20
|
"@types/amqplib": "0.8.2",
|
|
21
21
|
"@types/uuid": "^8.3.3",
|
|
22
22
|
"amqp-connection-manager": "4.1.9",
|
package/src/index.ts
CHANGED
|
@@ -482,11 +482,16 @@ class RabbitMq implements IAfRabbitMq {
|
|
|
482
482
|
|
|
483
483
|
const traceId = msg.properties.headers[TRACING_HEADER];
|
|
484
484
|
const userId = msg.properties.headers[USER_TRACING_HEADER];
|
|
485
|
+
logger.info('rabbit: consume', { traceId, userId, enableRabbitTrace });
|
|
485
486
|
if (traceId) {
|
|
486
487
|
const trace = newTrace(traceTypes.RABBIT);
|
|
487
488
|
(trace as any)?.context?.set(TRACING_HEADER, traceId);
|
|
488
489
|
} else if (userId && enableRabbitTrace) {
|
|
489
|
-
|
|
490
|
+
try {
|
|
491
|
+
await setRabbitTrace(userId);
|
|
492
|
+
} catch (e) {
|
|
493
|
+
logger.error('rabbit: failed to setRabbitTrace', { userId, e });
|
|
494
|
+
}
|
|
490
495
|
}
|
|
491
496
|
|
|
492
497
|
if (auditContext) {
|