@appolo/bus
Advanced tools
Comparing version 8.1.2 to 8.1.3
@@ -113,5 +113,6 @@ "use strict"; | ||
} | ||
async getQueueMessagesCount(queue) { | ||
async getQueueMessagesCount(params) { | ||
let { queue, connection } = params; | ||
queue = this.topologyManager.appendEnv(queue) || this.topologyManager.getDefaultQueueName(); | ||
let apiQueue = await this.client.api.getQueue({ name: queue }); | ||
let apiQueue = await this.client.api.getQueue({ name: queue, connection }); | ||
return apiQueue ? apiQueue.messages : 0; | ||
@@ -118,0 +119,0 @@ } |
@@ -7,3 +7,3 @@ "use strict"; | ||
import {HttpService} from '@appolo/http'; | ||
import {Rabbit, IPublishOptions, IRequestOptions, IConnectionOptions,RabbitApi} from "appolo-rabbit"; | ||
import {Rabbit, IPublishOptions, IRequestOptions, IConnectionOptions, RabbitApi} from "appolo-rabbit"; | ||
import {TopologyManager} from "../topology/topologyManager"; | ||
@@ -194,7 +194,9 @@ import {MessageManager} from "../messages/messageManager"; | ||
public async getQueueMessagesCount(queue: string): Promise<number> { | ||
public async getQueueMessagesCount(params: { queue: string, connection?: string }): Promise<number> { | ||
let {queue, connection} = params; | ||
queue = this.topologyManager.appendEnv(queue) || this.topologyManager.getDefaultQueueName(); | ||
let apiQueue = await this.client.api.getQueue({name: queue}); | ||
let apiQueue = await this.client.api.getQueue({name: queue, connection}); | ||
@@ -204,3 +206,3 @@ return apiQueue ? apiQueue.messages : 0; | ||
public api():RabbitApi { | ||
public api(): RabbitApi { | ||
return this.client.api; | ||
@@ -207,0 +209,0 @@ } |
{ | ||
"name": "@appolo/bus", | ||
"version": "8.1.2", | ||
"version": "8.1.3", | ||
"description": "appolo bus module", | ||
@@ -18,3 +18,3 @@ "publishConfig": { | ||
"@appolo/engine": "^8.0.23", | ||
"appolo-rabbit": "^8.1.2", | ||
"appolo-rabbit": "^8.1.3", | ||
"@appolo/utils": "^8.0.5" | ||
@@ -21,0 +21,0 @@ }, |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
103096
53
0
1651
Updatedappolo-rabbit@^8.1.3