No longer possible to bind queues in parallel
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.
It was probably not intended. Probably easy to find the commit that broke it using https://git-scm.com/docs/git-bisect
That's a good idea, I'll try that.
Looks like d464ef2 is responsible for this.
So it actually broke in v3.1.0, v3.0.0 works fine.
Suspected it had with that todo.. will have to find a solution
On Thu, 5 Oct 2023, 10:52 Jonas Scheffner, @.***> wrote:
So it actually broke in v3.1.0, v3.0.0 works fine.
— Reply to this email directly, view it on GitHub https://github.com/cloudamqp/amqp-client.js/issues/94#issuecomment-1748408767, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABL6TTU7QMF7DTC6WH5V5DX5ZYNLAVCNFSM6AAAAAA5SSU5IGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBYGQYDQNZWG4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>
A spec is the first step
On Thu, 5 Oct 2023, 11:44 Carl Hörberg, @.***> wrote:
Suspected it had with that todo.. will have to find a solution
On Thu, 5 Oct 2023, 10:52 Jonas Scheffner, @.***> wrote:
So it actually broke in v3.1.0, v3.0.0 works fine.
— Reply to this email directly, view it on GitHub https://github.com/cloudamqp/amqp-client.js/issues/94#issuecomment-1748408767, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABL6TTU7QMF7DTC6WH5V5DX5ZYNLAVCNFSM6AAAAAA5SSU5IGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBYGQYDQNZWG4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>