Closed anton-ryzhov closed 8 years ago
Pls add a test for it. Something like:
class WhenISendZeroMessage(BoundQueueContext):
def given_an_empty_message(self):
self.message = asynqp.Message('')
self.exchange.publish(self.message, 'routingkey')
def when_I_start_a_consumer(self):
self.message_received = asyncio.Future()
self.loop.run_until_complete(asyncio.wait_for(self.start_consumer(), 0.2))
def it_should_deliver_the_message_to_the_consumer(self):
assert self.message_received.result() == self.message
@asyncio.coroutine
def start_consumer(self):
yield from self.queue.consume(self.message_received.set_result)
yield from self.message_received
in integration tests should be ok. The patch looks good.
Thank you for help, I understood nothing about your test system.
Ye, it's the first thing we agreed on changing in v0.6
What about this PR, will you merge?
I am not a contributor =) @benjamin-hodgson Has to view all of it.
Thanks for the contribution. Looks good!
When RabbitMQ sends message without payload — it sends only
Content Header
frame, but noContend Body
.asynqp
waits forContend Body
even ifbody_length == 0
. Message becomes never fully received and never acked. Breaks entire consumer if it limitsprefetch count
.