[rabbitmq-discuss] Trouble with confirms

Ceri Storey ceri at lshift.net
Tue Jul 30 17:05:11 BST 2013


(30/07/13 16:30), Tom Anderson wrote:
> On 29/07/13 17:51, Ceri Storey wrote:
>> (29/07/13 17:25), Tom Anderson wrote:
>>> On 29/07/13 13:40, Matthias Radestock wrote:
>>>> ...
>>>
>>> Aha. I didn't realise, that, thanks.
>>>
>>> What i'm looking for is a way to get some sort of feedback at the
>>> sender when a message has been acknowledged by the consumer. Given
>>> that transient messages are confirmed as soon as the message has
>>> reached the queue, and persistent messages are confirmed as soon as
>>> they are written to disk, am i right in concluding that there is no
>>> way to do this with confirms? Is there any other mechanism in
>>> RabbitMQ that might let me do this?
>>>
>>> My real goal here is to write a test for an application of ours, to
>>> assert that it is only acknowledging messages after it has
>>> successfully processed them, and not immediately on receipt. If
>>> anyone has any thoughts on how i might be able to do that, i would
>>> be very excited to hear them!
>> For your test, I'd be very tempted to provide an adapter which
>> enforces the guarantees you want to make. Then you can have tests that:
>>
>>   * For the happy path, asserts that no more messages exist on the
>>     expected (ie: that a basic.get will return no messages)
>>   * For the failure path, asserts that the sent message is available
>>     to other consumers once your adapter has properly failed and shut
>>     down.
>>
>> Granted, the latter does assume that you can shut down the adapter
>> reasonably easily.
>>
>
> Apologies if i'm being thick, but what do you mean by "adapter"? Do
> you mean code that sits between the application code and the AMQP
> library? Or code that the test can use to take a grip on the
> application code? Or something else?
Yes, sorry, that's it, so it's an interface to external infrastructure
(in this case Rabbit), that presents itself in terms of something
relevant to your application. So in my case, I tell it what what kinds
of job I want to receive, and it would call back to another object when
there is a job to be done. It's a term pulled from Alistair Cockburn's
Hexagonal Architecture
<http://alistair.cockburn.us/Hexagonal+architecture>, FWIW.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130730/34bd2f8e/attachment.htm>


More information about the rabbitmq-discuss mailing list