@sellout/service 0.0.65 → 0.0.67
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.
|
@@ -5,214 +5,211 @@ const BROADCAST_PREFIX = 'BROADCAST'; /* Prefix for broadcast messages */
|
|
|
5
5
|
/**
|
|
6
6
|
* Exposes connection operations for NATS.
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
this.logPrefix = 'NatsConnectionManager';
|
|
18
|
-
/**
|
|
19
|
-
* Publish request for service.
|
|
20
|
-
*
|
|
21
|
-
* @param {string} serviceId - Service Id of receipient
|
|
22
|
-
* @param {string} method - Id of method to call
|
|
23
|
-
* @param {Buffer} req - Request buffer
|
|
24
|
-
* @callback cb - Reply callback
|
|
25
|
-
* @param { number} [timeout] - Register a default timeout for requests
|
|
26
|
-
*/
|
|
27
|
-
// tslint:disable-next-line:max-line-length
|
|
28
|
-
this.send = (serviceId, method, req, cb, timeout) => {
|
|
29
|
-
const subject = [serviceId, method].join('.');
|
|
30
|
-
const msgId = this.conn.requestOne(subject, req, {}, timeout == null ? this.defaultRequestTimeout : timeout, (reply) => {
|
|
31
|
-
this.logMessage(`Sending message: ${subject} (${msgId})`);
|
|
32
|
-
if (reply.code && reply.code === NATS.REQ_TIMEOUT) {
|
|
33
|
-
this.logMessage(`Reply for (${msgId}): ${JSON.stringify(reply)}`, true);
|
|
34
|
-
const error = new NatsConnectionManager.TIMEOUT_ERROR({
|
|
35
|
-
message: `Timeout sending request: ${subject} (${msgId})`,
|
|
36
|
-
});
|
|
37
|
-
cb(error, null);
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
this.logMessage(`Received reply: ${subject} (${msgId})`);
|
|
41
|
-
cb(null, reply);
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Publish a broadcast message
|
|
46
|
-
*/
|
|
47
|
-
this.sendBroadcast = (messageId, req, cb) => {
|
|
48
|
-
return this.sendAsync(BROADCAST_PREFIX, messageId, req, cb);
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* Publish asynchronous request for service.
|
|
52
|
-
*
|
|
53
|
-
* @param {string} serviceId - Service Id of receipient
|
|
54
|
-
* @param {string} method - Id of method to call
|
|
55
|
-
* @param {Buffer} req - Request buffer
|
|
56
|
-
* @callback cb - Reply callback
|
|
57
|
-
*/
|
|
58
|
-
this.sendAsync = (serviceId, method, req, cb) => {
|
|
59
|
-
const subject = [serviceId, method].join('.');
|
|
60
|
-
this.conn.publish(subject, req, (reply) => {
|
|
61
|
-
this.logMessage(`Queued message: ${subject}`);
|
|
62
|
-
// NATS always returns "undefined" for publish, since reply is N/A.
|
|
63
|
-
// Protobuf Services require _some_ kind of Type (cannot be undefined or void).
|
|
64
|
-
// thus, return an empty `<Buffer >` here, which can be marshalled to the `google.protobuf.Empty` type.
|
|
65
|
-
const empty = Buffer.from([]);
|
|
66
|
-
cb(null, empty);
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
this.logger = logger;
|
|
70
|
-
this.natsServers = natsServers;
|
|
71
|
-
this.verbose = verbose;
|
|
72
|
-
if (process.env.NATS_TIMEOUT) {
|
|
73
|
-
this.defaultRequestTimeout = parseInt(process.env.NATS_TIMEOUT, 10);
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
this.defaultRequestTimeout = defaultRequestTimeout;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
8
|
+
class NatsConnectionManager {
|
|
9
|
+
/**
|
|
10
|
+
* Manages connections to NATS servers.
|
|
11
|
+
* @constructor
|
|
12
|
+
*
|
|
13
|
+
* @param {boolean} verbose - Log all events if true
|
|
14
|
+
*/
|
|
15
|
+
constructor(natsServers, logger, verbose = false, defaultRequestTimeout = 60000) {
|
|
16
|
+
this.logPrefix = 'NatsConnectionManager';
|
|
79
17
|
/**
|
|
80
|
-
*
|
|
18
|
+
* Publish request for service.
|
|
81
19
|
*
|
|
82
|
-
* @param {string
|
|
20
|
+
* @param {string} serviceId - Service Id of receipient
|
|
21
|
+
* @param {string} method - Id of method to call
|
|
22
|
+
* @param {Buffer} req - Request buffer
|
|
23
|
+
* @callback cb - Reply callback
|
|
24
|
+
* @param { number} [timeout] - Register a default timeout for requests
|
|
83
25
|
*/
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
26
|
+
// tslint:disable-next-line:max-line-length
|
|
27
|
+
this.send = (serviceId, method, req, cb, timeout) => {
|
|
28
|
+
const subject = [serviceId, method].join('.');
|
|
29
|
+
const msgId = this.conn.requestOne(subject, req, {}, timeout == null ? this.defaultRequestTimeout : timeout, (reply) => {
|
|
30
|
+
this.logMessage(`Sending message: ${subject} (${msgId})`);
|
|
31
|
+
if (reply.code && reply.code === NATS.REQ_TIMEOUT) {
|
|
32
|
+
this.logMessage(`Reply for (${msgId}): ${JSON.stringify(reply)}`, true);
|
|
33
|
+
const error = new NatsConnectionManager.TIMEOUT_ERROR({
|
|
34
|
+
message: `Timeout sending request: ${subject} (${msgId})`,
|
|
35
|
+
});
|
|
36
|
+
cb(error, null);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
this.logMessage(`Received reply: ${subject} (${msgId})`);
|
|
40
|
+
cb(null, reply);
|
|
41
|
+
});
|
|
42
|
+
};
|
|
100
43
|
/**
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
* @param event
|
|
104
|
-
* @callback cb
|
|
44
|
+
* Publish a broadcast message
|
|
105
45
|
*/
|
|
106
|
-
|
|
107
|
-
this.
|
|
108
|
-
}
|
|
46
|
+
this.sendBroadcast = (messageId, req, cb) => {
|
|
47
|
+
return this.sendAsync(BROADCAST_PREFIX, messageId, req, cb);
|
|
48
|
+
};
|
|
109
49
|
/**
|
|
110
|
-
*
|
|
50
|
+
* Publish asynchronous request for service.
|
|
111
51
|
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* @param service - Service Id of listener
|
|
117
|
-
* @param @optional {string} - Optional name of queue to subscribe
|
|
118
|
-
* @param {SubscriptionRoutes} routes - Mapping of method Ids to handlers
|
|
52
|
+
* @param {string} serviceId - Service Id of receipient
|
|
53
|
+
* @param {string} method - Id of method to call
|
|
54
|
+
* @param {Buffer} req - Request buffer
|
|
55
|
+
* @callback cb - Reply callback
|
|
119
56
|
*/
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const topic = [BROADCAST_PREFIX, r].join('.');
|
|
130
|
-
const queue = `${serviceId}-${r}`;
|
|
131
|
-
this.subscribeTopic(topic, queue, { [r]: routes[r] });
|
|
57
|
+
this.sendAsync = (serviceId, method, req, cb) => {
|
|
58
|
+
const subject = [serviceId, method].join('.');
|
|
59
|
+
this.conn.publish(subject, req, (reply) => {
|
|
60
|
+
this.logMessage(`Queued message: ${subject}`);
|
|
61
|
+
// NATS always returns "undefined" for publish, since reply is N/A.
|
|
62
|
+
// Protobuf Services require _some_ kind of Type (cannot be undefined or void).
|
|
63
|
+
// thus, return an empty `<Buffer >` here, which can be marshalled to the `google.protobuf.Empty` type.
|
|
64
|
+
const empty = Buffer.from([]);
|
|
65
|
+
cb(null, empty);
|
|
132
66
|
});
|
|
67
|
+
};
|
|
68
|
+
this.logger = logger;
|
|
69
|
+
this.natsServers = natsServers;
|
|
70
|
+
this.verbose = verbose;
|
|
71
|
+
if (process.env.NATS_TIMEOUT) {
|
|
72
|
+
this.defaultRequestTimeout = parseInt(process.env.NATS_TIMEOUT, 10);
|
|
133
73
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
opts.queue = queue;
|
|
137
|
-
this.conn.subscribe(topicQualifier, opts, (req, reply, subject) => {
|
|
138
|
-
const method = subject.substring(subject.indexOf('.') + 1);
|
|
139
|
-
const handler = routes[method];
|
|
140
|
-
this.logMessage(`Receive message: full subject=${subject}, method=${method}, replyTo=${reply} `);
|
|
141
|
-
handler.process(req).then((resp) => {
|
|
142
|
-
if (reply) {
|
|
143
|
-
this.logMessage(`Publishing reply: ${reply}`);
|
|
144
|
-
this.conn.publish(reply, resp);
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
this.logMessage('No reply required');
|
|
148
|
-
}
|
|
149
|
-
}, (reason) => {
|
|
150
|
-
this.logMessage(`Handler failed. Reason= ${reason}`, false);
|
|
151
|
-
throw new NatsConnectionManager.MESSAGE_HANDLER_ERROR(reason, subject);
|
|
152
|
-
});
|
|
153
|
-
});
|
|
74
|
+
else {
|
|
75
|
+
this.defaultRequestTimeout = defaultRequestTimeout;
|
|
154
76
|
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Connect to one of the specified servers.
|
|
80
|
+
*
|
|
81
|
+
* @param {string[]} servers - Array of server URLs for NATS (server is randomly chosen)
|
|
82
|
+
*/
|
|
83
|
+
connect(waitForConnect = true) {
|
|
84
|
+
const opts = {};
|
|
85
|
+
opts.servers = this.natsServers;
|
|
86
|
+
opts.preserveBuffers = true;
|
|
87
|
+
opts.verbose = this.verbose;
|
|
88
|
+
opts.waitOnFirstConnect = waitForConnect;
|
|
89
|
+
opts.maxReconnectAttempts = -1; /* Infinite reconnect attempts */
|
|
90
|
+
this.conn = NATS.connect(opts);
|
|
91
|
+
this.enableLogging();
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Close active connections.
|
|
95
|
+
*/
|
|
96
|
+
close() {
|
|
97
|
+
this.conn.close();
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Expose event system of Nats client.
|
|
101
|
+
*
|
|
102
|
+
* @param event
|
|
103
|
+
* @callback cb
|
|
104
|
+
*/
|
|
105
|
+
on(event, cb) {
|
|
106
|
+
this.conn.on(event, cb);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Subscribes a service listener to its methods within a NATS queue.
|
|
110
|
+
*
|
|
111
|
+
* IMPORTANT: Ensure service message handlers are defined via arrow functions
|
|
112
|
+
* to ensure instance variables of the class are accessible within
|
|
113
|
+
* the scope of the handlers.
|
|
114
|
+
*
|
|
115
|
+
* @param service - Service Id of listener
|
|
116
|
+
* @param @optional {string} - Optional name of queue to subscribe
|
|
117
|
+
* @param {SubscriptionRoutes} routes - Mapping of method Ids to handlers
|
|
118
|
+
*/
|
|
119
|
+
subscribe(serviceId, queue, routes) {
|
|
120
|
+
this.logMessage(`Subscribing handlers for service='${serviceId}', queue='${queue}'`);
|
|
121
|
+
const topic = [serviceId, '>'].join('.');
|
|
122
|
+
return this.subscribeTopic(topic, queue, routes); /* Match all topics containing Service Id */
|
|
123
|
+
}
|
|
124
|
+
subscribeBroadcast(serviceId, routes) {
|
|
125
|
+
const routeNames = Object.keys(routes);
|
|
126
|
+
this.logMessage(`Subscribing handlers for broadcast: [${routeNames.join(', ')}]`);
|
|
127
|
+
routeNames.forEach((r) => {
|
|
128
|
+
const topic = [BROADCAST_PREFIX, r].join('.');
|
|
129
|
+
const queue = `${serviceId}-${r}`;
|
|
130
|
+
this.subscribeTopic(topic, queue, { [r]: routes[r] });
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
subscribeTopic(topicQualifier, queue, routes) {
|
|
134
|
+
const opts = {};
|
|
135
|
+
opts.queue = queue;
|
|
136
|
+
this.conn.subscribe(topicQualifier, opts, (req, reply, subject) => {
|
|
137
|
+
const method = subject.substring(subject.indexOf('.') + 1);
|
|
138
|
+
const handler = routes[method];
|
|
139
|
+
this.logMessage(`Receive message: full subject=${subject}, method=${method}, replyTo=${reply} `);
|
|
140
|
+
handler.process(req).then((resp) => {
|
|
141
|
+
if (reply) {
|
|
142
|
+
this.logMessage(`Publishing reply: ${reply}`);
|
|
143
|
+
this.conn.publish(reply, resp);
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
this.logMessage('No reply required');
|
|
147
|
+
}
|
|
148
|
+
}, (reason) => {
|
|
149
|
+
this.logMessage(`Handler failed. Reason= ${reason}`, false);
|
|
150
|
+
throw new NatsConnectionManager.MESSAGE_HANDLER_ERROR(reason, subject);
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Register for logged connection events
|
|
156
|
+
*/
|
|
157
|
+
enableLogging() {
|
|
155
158
|
/**
|
|
156
|
-
*
|
|
159
|
+
* GENERIC ERROR LOGGING
|
|
157
160
|
*/
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
this.logMessage(err, false);
|
|
164
|
-
});
|
|
165
|
-
if (!this.verbose) {
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* VERBOSE EVENT LOGGING
|
|
170
|
-
*/
|
|
171
|
-
this.conn.on('connect', (conn) => {
|
|
172
|
-
this.logMessage(`Connection established to ${conn.currentServer.url.host}`);
|
|
173
|
-
});
|
|
174
|
-
this.conn.on('disconnect', () => {
|
|
175
|
-
this.logMessage('Disconnected', false);
|
|
176
|
-
});
|
|
177
|
-
this.conn.on('reconnect', () => {
|
|
178
|
-
this.logMessage('Reconnected', false);
|
|
179
|
-
});
|
|
180
|
-
this.conn.on('close', () => {
|
|
181
|
-
this.logMessage('Connection closed');
|
|
182
|
-
});
|
|
161
|
+
this.conn.on('error', (err) => {
|
|
162
|
+
this.logMessage(err, false);
|
|
163
|
+
});
|
|
164
|
+
if (!this.verbose) {
|
|
165
|
+
return;
|
|
183
166
|
}
|
|
184
167
|
/**
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
* @param msg
|
|
168
|
+
* VERBOSE EVENT LOGGING
|
|
188
169
|
*/
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
170
|
+
this.conn.on('connect', (conn) => {
|
|
171
|
+
this.logMessage(`Connection established to ${conn.currentServer.url.host}`);
|
|
172
|
+
});
|
|
173
|
+
this.conn.on('disconnect', () => {
|
|
174
|
+
this.logMessage('Disconnected', false);
|
|
175
|
+
});
|
|
176
|
+
this.conn.on('reconnect', () => {
|
|
177
|
+
this.logMessage('Reconnected', false);
|
|
178
|
+
});
|
|
179
|
+
this.conn.on('close', () => {
|
|
180
|
+
this.logMessage('Connection closed');
|
|
181
|
+
});
|
|
194
182
|
}
|
|
195
183
|
/**
|
|
196
|
-
*
|
|
197
|
-
* a message handler.
|
|
184
|
+
* Log a message
|
|
198
185
|
*
|
|
186
|
+
* @param msg
|
|
199
187
|
*/
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
this.errors = errors;
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
/**
|
|
207
|
-
* Exception caused by request timeout.
|
|
208
|
-
*/
|
|
209
|
-
NatsConnectionManager.TIMEOUT_ERROR = class extends Error {
|
|
210
|
-
constructor(errors) {
|
|
211
|
-
super('NATS Timeout');
|
|
212
|
-
this.errors = errors;
|
|
188
|
+
logMessage(msg, info = true) {
|
|
189
|
+
if (!info || this.verbose) {
|
|
190
|
+
this.logger.info(`(${this.logPrefix}) ${msg}`);
|
|
213
191
|
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Exception representing an error that occurred during invocation of
|
|
196
|
+
* a message handler.
|
|
197
|
+
*
|
|
198
|
+
*/
|
|
199
|
+
NatsConnectionManager.MESSAGE_HANDLER_ERROR = class extends Error {
|
|
200
|
+
constructor(errors, messageSubject) {
|
|
201
|
+
super(`Error from message handler for '${messageSubject}'. Reason = ${JSON.stringify(errors)}`);
|
|
202
|
+
this.errors = errors;
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
/**
|
|
206
|
+
* Exception caused by request timeout.
|
|
207
|
+
*/
|
|
208
|
+
NatsConnectionManager.TIMEOUT_ERROR = class extends Error {
|
|
209
|
+
constructor(errors) {
|
|
210
|
+
super('NATS Timeout');
|
|
211
|
+
this.errors = errors;
|
|
212
|
+
}
|
|
213
|
+
};
|
|
217
214
|
exports.default = NatsConnectionManager;
|
|
218
215
|
//# sourceMappingURL=NatsConnectionManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NatsConnectionManager.js","sourceRoot":"","sources":["../src/NatsConnectionManager.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,6BAA6B;AAG7B,MAAM,gBAAgB,GAAG,WAAW,CAAC,CAAC,mCAAmC;AAEzE;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"NatsConnectionManager.js","sourceRoot":"","sources":["../src/NatsConnectionManager.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,6BAA6B;AAG7B,MAAM,gBAAgB,GAAG,WAAW,CAAC,CAAC,mCAAmC;AAEzE;;GAEG;AACH,MAAM,qBAAqB;IAoCzB;;;;;OAKG;IACH,YAAY,WAAqB,EAAE,MAAmB,EAAE,OAAO,GAAG,KAAK,EAAE,qBAAqB,GAAG,KAAK;QAT9F,cAAS,GAAG,uBAAuB,CAAC;QAyG5C;;;;;;;;WAQG;QACH,2CAA2C;QACpC,SAAI,GAAG,CAAC,SAAiB,EAAE,MAAc,EAAE,GAAW,EAAE,EAA0B,EAAE,OAAgB,EAAQ,EAAE;YAEnH,MAAM,OAAO,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAE9C,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAChC,OA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json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sellout/service",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.67",
|
|
4
4
|
"description": "Sellout.io base service",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"author": "samheutmaker@gmail.com",
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@sellout/models": "^0.0.
|
|
19
|
-
"@sellout/utils": "^0.0.
|
|
18
|
+
"@sellout/models": "^0.0.67",
|
|
19
|
+
"@sellout/utils": "^0.0.67",
|
|
20
20
|
"@sentry/node": "^5.14.2",
|
|
21
21
|
"analytics-node": "^3.4.0-beta.1",
|
|
22
22
|
"express": "^4.17.1",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"nodemon": "^2.0.2",
|
|
32
32
|
"typescript": "^3.8.3"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "c54371e8d53146a1650b287c69e6d4d585256c3d"
|
|
35
35
|
}
|