Codeception / module-amqp

AMQP module for Codeception
MIT License
3 stars 6 forks source link

Stop keeping messages in unacked state #10

Closed renq closed 3 years ago

renq commented 3 years ago

Here is explanation why: https://github.com/Codeception/module-amqp/issues/11

Naktibalda commented 3 years ago

grabMessageFromQueue has the same issue, right?

Your change broke countQueue test, please update it. It definitely requires major version bump.

renq commented 3 years ago

I fixed the tests.

I also changed nack($requeue=true) to ack(). I found in the comment above method seeMessageInQueueContainsText a sentence "This method drops a message from queue". If this was the intention of the author of this method, ack() seems to fit here better and which is more important, in my opinion, it doesn't break backward compatibility. I would treat my change as a bugfix.

Regarding grabMessageFromQueue - I think there is no bug here. It's a feature. :) This method returns \PhpAmqpLib\Message\AMQPMessage, so users can do whatever they want with that. They can leave it unacknowledged by doing nothing or ack/nack the message.