[rabbitmq-discuss] Fwd: question on the faq

Ben Hood 0x6e6562 at gmail.com
Wed Jan 7 11:34:31 GMT 2009


Tim,

On Tue, Jan 6, 2009 at 7:32 PM, Tim Coote <tim+rabbitmq.com at coote.org> wrote:
> b) is the correct answer. That's what a transaction means - you cannot dip
> in and out of the transaction.
>
> However, it is possible to have a compensating transaction, as part of the
> rollback - eg the downstream systems may not support enough state
> transitions, so a booking would imply a contract, which would have a cost to
> get out of.  This is the common approach for any systems that drive the
> physical world (eg producing printed material or driving a robot.)  Even in
> this type of scenario, the transactional model makes it easier to get the
> analysis complete and correct, although it's better to get the downstream
> systems to support suitable states.  eg, in the real world, I can make a
> provisional booking, which times out if I don't commit to a firm booking
> within a known (possibly variable) timeline.

So you intend to keep an exclusive lock on the entities that you
requesting from the downstream system for the duration of the unit of
work?

> I find that without this approach, the overall requirements/analysis and
> design is frequently incomplete, revealing inconsistencies between the
> assumptions of the upstream and downstream systems and costly remediation.

If those are you requirements then my initial feeling is that a
messaging system like Rabbit would be a poor fit for your use case.

This is because to make the requests visible to the downstream system
before the transaction commits, all of those systems would have to
participate in the same transaction. To do this, you would have to
extend the transactional context to each participant, which is not
possible (in Rabbit) without any application level code to propagate
the distributed consensus.

Hence my recommendation is to either take the example that Carl wrote
yesterday or use middleware that is less asynchronous.

BTW Carl - would it be possible to have a look at the code that you
wrote for Tim? It may clarify my lack of understanding.

Ben




More information about the rabbitmq-discuss mailing list