@appolo/bus
Advanced tools
Comparing version 8.1.4 to 8.1.5
@@ -114,8 +114,13 @@ "use strict"; | ||
async getQueueMessagesCount(params) { | ||
let { queue, connection } = params; | ||
queue = this.topologyManager.appendEnv(queue) || this.topologyManager.getDefaultQueueName(); | ||
let { queue, connection, appendEnv } = params; | ||
if (queue) { | ||
queue = appendEnv ? this.topologyManager.appendEnv(queue) : queue; | ||
} | ||
else { | ||
queue = this.topologyManager.getDefaultQueueName(); | ||
} | ||
let apiQueue = await this.client.api.getQueue({ name: queue, connection }); | ||
return apiQueue ? apiQueue.messages : 0; | ||
} | ||
api() { | ||
get api() { | ||
return this.client.api; | ||
@@ -122,0 +127,0 @@ } |
@@ -193,7 +193,15 @@ "use strict"; | ||
public async getQueueMessagesCount(params: { queue: string, connection?: string }): Promise<number> { | ||
public async getQueueMessagesCount(params: { | ||
queue?: string, | ||
connection?: string, | ||
appendEnv?: boolean | ||
}): Promise<number> { | ||
let {queue, connection} = params; | ||
let {queue, connection, appendEnv} = params; | ||
queue = this.topologyManager.appendEnv(queue) || this.topologyManager.getDefaultQueueName(); | ||
if (queue) { | ||
queue = appendEnv ? this.topologyManager.appendEnv(queue) : queue; | ||
} else { | ||
queue = this.topologyManager.getDefaultQueueName(); | ||
} | ||
@@ -205,3 +213,3 @@ let apiQueue = await this.client.api.getQueue({name: queue, connection}); | ||
public api(): RabbitApi { | ||
public get api(): RabbitApi { | ||
return this.client.api; | ||
@@ -208,0 +216,0 @@ } |
{ | ||
"name": "@appolo/bus", | ||
"version": "8.1.4", | ||
"version": "8.1.5", | ||
"description": "appolo bus module", | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
103469
1664