Closed victor-solvethex closed 3 years ago
My code:
it('should consume messages from a previously created queue', async (done) => {
const chann = await rabbitService.getChannel()
chann.consume(
'cool_queue',
(msg: any) => {
expect(msg).toBeTruthy()
if (msg) expect(msg.content.toString()).toBe('Hello, World')
chann.ack(msg)
done()
},
{ consumerTag: 'yey' }
)
})
Okey I found the error, I was trying to use ack() on an already acknowledged message. I was using ConfirmChannels instead of normal Channels
So the issue is solved?
I'm trying to acknowledge a message with
channel.ack(msg)
but it fails for some reason using your library on tests