Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No longer possible to bind queues in parallel #94

Open
jscheffner opened this issue Oct 4, 2023 · 6 comments
Open

No longer possible to bind queues in parallel #94

jscheffner opened this issue Oct 4, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@jscheffner
Copy link

Hey, after updating to v3 this is no longer working

import { AMQPClient } from '@cloudamqp/amqp-client'

const amqp = new AMQPClient('amqp://localhost')
const conn = await amqp.connect()
const ch = await conn.channel()
const q = await ch.queue('test-queue')
await ch.exchangeDeclare('test-exchange', 'fanout')

console.log('A')

await Promise.all([
  q.bind('test-exchange', 'foo:*'),
  q.bind('test-exchange', 'bar:*'),
])

console.log('B')

A is still logged, B is not. The promise keeps pending when binding two routing keys at the same time. If run with v2 the Promise resolves and B is logged.

Binding sequentially works with both versions:

await q.bind('test-exchange', 'foo:*')
await q.bind('test-exchange', 'bar:*')

This is a bit unexpected and I didn't find anything in the changelog that suggests that this change was intended.

@dentarg
Copy link
Member

dentarg commented Oct 4, 2023

It was probably not intended. Probably easy to find the commit that broke it using https://git-scm.com/docs/git-bisect

@dentarg dentarg added the bug Something isn't working label Oct 4, 2023
@jscheffner
Copy link
Author

That's a good idea, I'll try that.

@jscheffner
Copy link
Author

Looks like d464ef2 is responsible for this.

@jscheffner
Copy link
Author

So it actually broke in v3.1.0, v3.0.0 works fine.

@jscheffner jscheffner changed the title No longer to bind queues in parallel No longer possible to bind queues in parallel Oct 5, 2023
@carlhoerberg
Copy link
Member

carlhoerberg commented Oct 5, 2023 via email

@carlhoerberg
Copy link
Member

carlhoerberg commented Oct 5, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants