wsp-ms-core 1.0.94 → 1.0.96

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.cjs CHANGED
@@ -1656,7 +1656,7 @@ var KafkaManager = class extends EventManager {
1656
1656
  await this.execCallback(this._onMessage, `[New message detected for ${topic}]: ${message.value?.toString()}`);
1657
1657
  const json = JSON.parse(String(message.value?.toString()));
1658
1658
  await this.execRoute(topic, {
1659
- topic: String(json.topic),
1659
+ topic: String(topic),
1660
1660
  producer: String(json.producer),
1661
1661
  tenant: UUID.create(String(json.tenant)),
1662
1662
  message: json.data
@@ -1960,8 +1960,8 @@ var DefaultMysqlInboxRunner = class {
1960
1960
 
1961
1961
  // src/infrastructure/runners/default-mysql-inbox-processor.ts
1962
1962
  var DefaultMysqlInboxProcessor = class {
1963
- constructor(repository) {
1964
- this.repository = repository;
1963
+ constructor(uowFactory) {
1964
+ this.uovFactory = uowFactory;
1965
1965
  }
1966
1966
  async sleep() {
1967
1967
  return new Promise((r) => setTimeout(r, 5e3));
@@ -1970,12 +1970,16 @@ var DefaultMysqlInboxProcessor = class {
1970
1970
  this.handlers.set(topic, handler);
1971
1971
  }
1972
1972
  async processRecords() {
1973
- const records = await this.repository.listPending(20);
1974
- for (let record of records) {
1975
- if (this.handlers.has(record.topic)) {
1976
- await this.handlers.get(record.topic)(record);
1973
+ const uow = await this.uovFactory.create();
1974
+ const repository = new InboxMysqlRepository(uow.connection);
1975
+ await uow.execute(async () => {
1976
+ const records = await repository.listPending(20);
1977
+ for (let record of records) {
1978
+ if (this.handlers.has(record.topic)) {
1979
+ await this.handlers.get(record.topic)(record);
1980
+ }
1977
1981
  }
1978
- }
1982
+ });
1979
1983
  }
1980
1984
  async start() {
1981
1985
  console.log("[inbox-runner-processor]: start");