podverse-mq 5.1.5-alpha.3 → 5.1.6-alpha.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/activeMQArtemis/index.ts"],"names":[],"mappings":"AACA,OAAO,EAA8C,QAAQ,EAAE,MAAM,MAAM,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAIzE,MAAM,MAAM,WAAW,GAAG,YAAY,GAAI,eAAe,GAAG,UAAU,CAAC;AAEvE,KAAK,YAAY,GAAG;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC,CAAC;AAEF,KAAK,OAAO,GAAG,YAAY,CAAC;AAE5B,KAAK,iBAAiB,GAAG;IACvB,SAAS,EAAE,WAAW,CAAA;IACtB,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAAA;IAC3B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;CACjC,CAAA;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,sBAAsB;IACjC,OAAO,CAAC,UAAU,CAA2B;IAC7C,OAAO,CAAC,OAAO,CAAuC;IACtD,OAAO,CAAC,SAAS,CAAyC;IAC1D,OAAO,CAAC,MAAM,CAA+B;IAC7C,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,UAAU,CAAS;gBAEf,MAAM,EAAE,4BAA4B,EAAE,MAAM,EAAE,aAAa;IAKjE,UAAU;YASF,OAAO;YAwDP,YAAY;YAaZ,cAAc;IAa5B,OAA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AC,OAAO,CAAuC;IACtD,OAAO,CAAC,SAAS,CAAyC;IAC1D,OAAO,CAAC,MAAM,CAA+B;IAC7C,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,UAAU,CAAS;gBAEf,MAAM,EAAE,4BAA4B,EAAE,MAAM,EAAE,aAAa;IAKjE,UAAU;YASF,OAAO;YAwDP,YAAY;YAaZ,cAAc;IAa5B,OAAO,CAAC,kBAAkB;IAQpB,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAyCrD,UAAU,CAAC,SAAS,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IA8B3D,eAAe,CAAC,SAAS,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,GAAG,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,QAAQ,CAAC;QAAC,KAAK,EAAE,WAAW,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;CAyBpJ"}
@@ -103,7 +103,7 @@ class ActiveMQArtemisService {
103
103
  return this.receivers.get(queueName);
104
104
  if (!this.connection)
105
105
  yield this.connect();
106
- const receiver = this.connection.open_receiver({ source: { address: queueName }, credit_window: 0 });
106
+ const receiver = this.connection.open_receiver({ source: { address: queueName }, credit_window: 10 });
107
107
  return new Promise((resolve) => {
108
108
  receiver.on('receiver_open', () => {
109
109
  this.logger.info(`Receiver ready for queue ${queueName}`);
@@ -196,7 +196,7 @@ class ActiveMQArtemisService {
196
196
  return __awaiter(this, void 0, void 0, function* () {
197
197
  try {
198
198
  const receiver = yield this.ensureReceiver(queueName);
199
- const handleMessage = (context) => __awaiter(this, void 0, void 0, function* () {
199
+ receiver.on('message', (context) => __awaiter(this, void 0, void 0, function* () {
200
200
  var _a, _b;
201
201
  if (context.receiver !== receiver)
202
202
  return;
@@ -210,15 +210,10 @@ class ActiveMQArtemisService {
210
210
  }
211
211
  catch (err) {
212
212
  this.logger.logError('Error processing message', err);
213
+ // It's important to still settle the message, otherwise it might be redelivered
213
214
  (_b = context.delivery) === null || _b === void 0 ? void 0 : _b.reject();
214
215
  }
215
- finally {
216
- // Request next message (one at a time for FIFO semantics)
217
- receiver.add_credit(1);
218
- }
219
- });
220
- receiver.on('message', handleMessage);
221
- receiver.add_credit(1); // Start consumption
216
+ }));
222
217
  this.logger.info(`Consumer is set up for queue ${queueName}`);
223
218
  }
224
219
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "podverse-mq",
3
- "version": "5.1.5-alpha.3",
3
+ "version": "5.1.6-alpha.1",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -17,10 +17,10 @@
17
17
  "license": "AGPLv3",
18
18
  "dependencies": {
19
19
  "module-alias": "^2.2.3",
20
- "podverse-external-services": "^5.1.5-alpha.2",
21
- "podverse-helpers": "^5.1.5-alpha.2",
22
- "podverse-orm": "^5.1.5-alpha.2",
23
- "podverse-parser": "^5.1.5-alpha.3",
20
+ "podverse-external-services": "^5.1.6-alpha.2",
21
+ "podverse-helpers": "^5.1.6-alpha.0",
22
+ "podverse-orm": "^5.1.6-alpha.0",
23
+ "podverse-parser": "^5.1.6-alpha.1",
24
24
  "rhea": "^2.0.6",
25
25
  "ws": "^8.18.3"
26
26
  },