@autofleet/rabbit 3.0.1-alpha2 → 3.0.1-alpha4
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 +3 -3
- package/package.json +2 -4
- package/src/index.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ const util_1 = require("util");
|
|
|
9
9
|
const moment_1 = __importDefault(require("moment"));
|
|
10
10
|
const redis_lock_1 = __importDefault(require("redis-lock"));
|
|
11
11
|
const amqp_connection_manager_1 = require("amqp-connection-manager");
|
|
12
|
-
const
|
|
12
|
+
const zehut_1 = require("@autofleet/zehut");
|
|
13
13
|
const logger_1 = __importDefault(require("./logger"));
|
|
14
14
|
const rabbitError_1 = __importDefault(require("./lib/rabbitError"));
|
|
15
15
|
const redis_1 = __importDefault(require("./lib/redis"));
|
|
@@ -124,7 +124,7 @@ class RabbitMq {
|
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
static getPublishOptions(customHeaders = {}) {
|
|
127
|
-
const trace =
|
|
127
|
+
const trace = zehut_1.getCurrentPayload();
|
|
128
128
|
return {
|
|
129
129
|
timestamp: moment_1.default().unix(),
|
|
130
130
|
headers: {
|
|
@@ -336,7 +336,7 @@ class RabbitMq {
|
|
|
336
336
|
}
|
|
337
337
|
const traceId = msg.properties.headers[consts_1.TRACING_HEADER];
|
|
338
338
|
if (traceId) {
|
|
339
|
-
const trace =
|
|
339
|
+
const trace = zehut_1.newTrace(zehut_1.traceTypes.RABBIT);
|
|
340
340
|
trace?.context?.set(consts_1.TRACING_HEADER, traceId);
|
|
341
341
|
logger_1.default.info(`rabbit: [consume] received message with traceId ${traceId}`, {
|
|
342
342
|
trace,
|
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-alpha4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@autofleet/logger": "^1.2.8",
|
|
19
|
+
"@autofleet/zehut": "^3.0.1",
|
|
19
20
|
"@types/amqplib": "0.8.2",
|
|
20
21
|
"@types/uuid": "^8.3.3",
|
|
21
22
|
"amqp-connection-manager": "4.1.9",
|
|
@@ -26,9 +27,6 @@
|
|
|
26
27
|
"redis-lock": "^0.1.4",
|
|
27
28
|
"uuid": "^8.3.2"
|
|
28
29
|
},
|
|
29
|
-
"peerDependencies": {
|
|
30
|
-
"@autofleet/outbreak": "^0.2.1"
|
|
31
|
-
},
|
|
32
30
|
"devDependencies": {
|
|
33
31
|
"@types/jest": "^26.0.23",
|
|
34
32
|
"@typescript-eslint/eslint-plugin": "^4.8.1",
|
package/src/index.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { AmqpConnectionManager, ChannelWrapper, connect } from 'amqp-connection-
|
|
|
8
8
|
import {
|
|
9
9
|
ConfirmChannel, ConsumeMessage, Options, Replies,
|
|
10
10
|
} from 'amqplib';
|
|
11
|
-
import { getCurrentContext, newTrace, traceTypes } from '@autofleet/
|
|
11
|
+
import { getCurrentPayload as getCurrentContext, newTrace, traceTypes } from '@autofleet/zehut';
|
|
12
12
|
import logger from './logger';
|
|
13
13
|
import RabbitError from './lib/rabbitError';
|
|
14
14
|
import getRedisInstance, { RedisConfig } from './lib/redis';
|