wsp-ms-core 1.0.89 → 1.0.91
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 +13 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1841,22 +1841,19 @@ var DefaultMysqlInboxRunner = class {
|
|
|
1841
1841
|
this.eventManager = eventManager;
|
|
1842
1842
|
}
|
|
1843
1843
|
async saveEvent(e, repository) {
|
|
1844
|
-
let record = new InboxRecord(
|
|
1845
|
-
UUID.create(),
|
|
1846
|
-
e.tenant,
|
|
1847
|
-
e.topic,
|
|
1848
|
-
e.producer,
|
|
1849
|
-
JSON.stringify(e.message),
|
|
1850
|
-
ProcessStatus.PENDING
|
|
1851
|
-
);
|
|
1852
1844
|
try {
|
|
1845
|
+
let record = new InboxRecord(
|
|
1846
|
+
UUID.create(),
|
|
1847
|
+
e.tenant,
|
|
1848
|
+
e.topic,
|
|
1849
|
+
e.producer,
|
|
1850
|
+
JSON.stringify(e.message),
|
|
1851
|
+
ProcessStatus.PENDING
|
|
1852
|
+
);
|
|
1853
1853
|
await repository.create(record);
|
|
1854
1854
|
} catch (error) {
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
throw new Error(type);
|
|
1858
|
-
} finally {
|
|
1859
|
-
await repository.update(record);
|
|
1855
|
+
console.log(error);
|
|
1856
|
+
throw error;
|
|
1860
1857
|
}
|
|
1861
1858
|
}
|
|
1862
1859
|
subscribeTo(topic) {
|
|
@@ -1871,6 +1868,9 @@ var DefaultMysqlInboxRunner = class {
|
|
|
1871
1868
|
this.eventManager.onMessage((data) => {
|
|
1872
1869
|
console.log(data);
|
|
1873
1870
|
});
|
|
1871
|
+
this.eventManager.onError((data) => {
|
|
1872
|
+
console.log(data);
|
|
1873
|
+
});
|
|
1874
1874
|
this.eventManager.route(topic, async (e) => {
|
|
1875
1875
|
await this.saveEvent(e, new InboxMysqlRepository(await this.databaseConnector.getConnection()));
|
|
1876
1876
|
});
|