Skip to content

Commit f8f94f0

Browse files
committed
Move filtering check at the beginning
1 parent 323baa7 commit f8f94f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ export class Client {
176176
this.socket.on("connect", async () => {
177177
this.logger.info(`Connected to RabbitMQ ${this.params.hostname}:${this.params.port}`)
178178
this.peerProperties = (await this.exchangeProperties()).properties
179+
this.filteringEnabled = lt(coerce(this.rabbitManagementVersion)!, REQUIRED_MANAGEMENT_VERSION) ? false : true
179180
await this.auth({ username: this.params.username, password: this.params.password })
180181
const { heartbeat } = await this.tune(this.params.heartbeat ?? 0)
181182
await this.open({ virtualHost: this.params.vhost })
@@ -440,7 +441,6 @@ export class Client {
440441

441442
public async createStream(params: { stream: string; arguments?: CreateStreamArguments }): Promise<true> {
442443
this.logger.debug(`Create Stream...`)
443-
this.filteringEnabled = lt(coerce(this.rabbitManagementVersion)!, REQUIRED_MANAGEMENT_VERSION) ? false : true
444444
const res = await this.sendAndWait<CreateStreamResponse>(new CreateStreamRequest(params))
445445
if (res.code === STREAM_ALREADY_EXISTS_ERROR_CODE) {
446446
return true

0 commit comments

Comments
 (0)