@autofleet/rabbit 3.0.1-alpha7 → 3.0.1-alpha8

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 CHANGED
@@ -342,13 +342,8 @@ class RabbitMq {
342
342
  const trace = zehut_1.newTrace(zehut_1.traceTypes.RABBIT);
343
343
  trace?.context?.set(consts_1.TRACING_HEADER, traceId);
344
344
  }
345
- else if (userId) {
346
- const trace = zehut_1.newTrace(zehut_1.traceTypes.RABBIT);
347
- trace?.context?.set(consts_1.USER_OBJECT, {
348
- id: userId,
349
- });
350
- }
351
- if (auditContext) {
345
+ else if (userId && auditContext) {
346
+ await zehut_1.setRabbitTrace(userId);
352
347
  auditContext(queue);
353
348
  }
354
349
  const parsedMessage = RabbitMq.parseMsg(msg);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autofleet/rabbit",
3
- "version": "3.0.1-alpha7",
3
+ "version": "3.0.1-alpha8",
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-alpha3",
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
@@ -8,7 +8,9 @@ import { AmqpConnectionManager, ChannelWrapper, connect } from 'amqp-connection-
8
8
  import {
9
9
  ConfirmChannel, ConsumeMessage, Options, Replies,
10
10
  } from 'amqplib';
11
- import { getCurrentPayload, newTrace, traceTypes } from '@autofleet/zehut';
11
+ import {
12
+ getCurrentPayload, newTrace, traceTypes, setRabbitTrace,
13
+ } from '@autofleet/zehut';
12
14
  import logger from './logger';
13
15
  import RabbitError from './lib/rabbitError';
14
16
  import getRedisInstance, { RedisConfig } from './lib/redis';
@@ -483,14 +485,8 @@ class RabbitMq implements IAfRabbitMq {
483
485
  if (traceId) {
484
486
  const trace = newTrace(traceTypes.RABBIT);
485
487
  (trace as any)?.context?.set(TRACING_HEADER, traceId);
486
- } else if (userId) {
487
- const trace = newTrace(traceTypes.RABBIT);
488
- (trace as any)?.context?.set(USER_OBJECT, {
489
- id: userId,
490
- });
491
- }
492
-
493
- if (auditContext) {
488
+ } else if (userId && auditContext) {
489
+ await setRabbitTrace(userId);
494
490
  auditContext(queue);
495
491
  }
496
492