@seidor-cloud-produtos/orbit-backend-lib 2.0.13 → 2.0.15
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.
|
@@ -7,7 +7,7 @@ export type LogPayload = Omit<LogProperties, 'expirationHours'> & {
|
|
|
7
7
|
};
|
|
8
8
|
export default class LogEvent implements DomainEvent {
|
|
9
9
|
readonly input: LogPayload;
|
|
10
|
-
readonly name = "
|
|
10
|
+
readonly name = "log-service.log.created";
|
|
11
11
|
readonly eventDate: Date;
|
|
12
12
|
constructor(input: LogPayload);
|
|
13
13
|
}
|
|
@@ -8,7 +8,7 @@ const log_error_1 = tslib_1.__importDefault(require("../../domain/errors/log-err
|
|
|
8
8
|
const types_1 = require("../environment/types");
|
|
9
9
|
class LogEvent {
|
|
10
10
|
input;
|
|
11
|
-
name = '
|
|
11
|
+
name = 'log-service.log.created';
|
|
12
12
|
eventDate = new Date();
|
|
13
13
|
constructor(input) {
|
|
14
14
|
this.input = input;
|
|
@@ -22,7 +22,7 @@ export default class AmqpQueue implements QueueConnection {
|
|
|
22
22
|
publish(exchangeName: string, domainEvent: DomainEvent, configs?: Record<string, any>): Promise<void>;
|
|
23
23
|
createConsumers(queueName: string, configs: CreateConsumers): Promise<void>;
|
|
24
24
|
setController(controller?: QueueController): this;
|
|
25
|
-
static getInstance(vHost: string): Promise<AmqpQueue>;
|
|
25
|
+
static getInstance(vHost: string, uri?: string): Promise<AmqpQueue>;
|
|
26
26
|
private treatReconnection;
|
|
27
27
|
private reconnectionChannels;
|
|
28
28
|
private publishMessagesOfMemory;
|
|
@@ -14,7 +14,7 @@ class AmqpQueue {
|
|
|
14
14
|
this.uri = uri;
|
|
15
15
|
}
|
|
16
16
|
async connect(vHost) {
|
|
17
|
-
const urlConnection = `${this.uri}
|
|
17
|
+
const urlConnection = `${this.uri}${vHost === '/' ? '/' : `/${vHost}`}`;
|
|
18
18
|
this.connection = await amqplib_1.default.connect(urlConnection);
|
|
19
19
|
this.vHost = vHost;
|
|
20
20
|
await this.treatReconnection(vHost);
|
|
@@ -154,11 +154,11 @@ class AmqpQueue {
|
|
|
154
154
|
}
|
|
155
155
|
return this;
|
|
156
156
|
}
|
|
157
|
-
static async getInstance(vHost) {
|
|
157
|
+
static async getInstance(vHost, uri) {
|
|
158
158
|
if (AmqpQueue.instance && AmqpQueue.instance.vHost === vHost) {
|
|
159
159
|
return AmqpQueue.instance;
|
|
160
160
|
}
|
|
161
|
-
const queue = new AmqpQueue();
|
|
161
|
+
const queue = new AmqpQueue(uri);
|
|
162
162
|
AmqpQueue.instance = await queue.connect(vHost);
|
|
163
163
|
return AmqpQueue.instance;
|
|
164
164
|
}
|