Hey,

How do you recommend handling the case where a local application
database transaction may commit or rollback, and you don't want to
publish the event unless it commits? In other words:

1 - application transaction begins
2 - application writes to database
3 - rmq message published (publish must succeed for application
transaction to succeed)
4 - application transaction commits; however, issue occurs, transaction
does not complete; must prevent rmq publish

Can't move #3 after #4 because the possibility exists that rmq publish
will fail and message will never be published.

This points to 2pc of application and rmq, but unavailable for the
application database. BTW, does rmq 2pc with other databases?

Vaughn

--

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110411/746d8e5b/attachment.htm>

Search Discussions

  • Vaughn Vernon at Apr 13, 2011 at 5:15 am
    Hello,

    Would it be possible to get some input on this? I've read through docs,
    wiki, faq, and archives and haven't found what I need.

    Even if the answer is that this won't work it would help me.

    Thanks!

    Vaughn

    --
    On 4/11/2011 10:31 PM, Vaughn Vernon wrote:
    Hey,

    How do you recommend handling the case where a local application
    database transaction may commit or rollback, and you don't want to
    publish the event unless it commits? In other words:

    1 - application transaction begins
    2 - application writes to database
    3 - rmq message published (publish must succeed for application
    transaction to succeed)
    4 - application transaction commits; however, issue occurs,
    transaction does not complete; must prevent rmq publish

    Can't move #3 after #4 because the possibility exists that rmq publish
    will fail and message will never be published.

    This points to 2pc of application and rmq, but unavailable for the
    application database. BTW, does rmq 2pc with other databases?

    Vaughn

    --
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110412/a6318952/attachment-0001.htm>
  • Tim Fox at Apr 13, 2011 at 2:02 pm
    RabbitMQ clients don't expose any sort of XA/JTA interface so enlisting
    a Rabbit local tx in a larger global XA tx won't be possible.

    You can probably find other ways to ensure atomicity by some kind of
    resend approach and detecting duplicates.
    On -10/01/37 20:59, Vaughn Vernon wrote:
    Hey,

    How do you recommend handling the case where a local application
    database transaction may commit or rollback, and you don't want to
    publish the event unless it commits? In other words:

    1 - application transaction begins
    2 - application writes to database
    3 - rmq message published (publish must succeed for application
    transaction to succeed)
    4 - application transaction commits; however, issue occurs,
    transaction does not complete; must prevent rmq publish

    Can't move #3 after #4 because the possibility exists that rmq publish
    will fail and message will never be published.

    This points to 2pc of application and rmq, but unavailable for the
    application database. BTW, does rmq 2pc with other databases?

    Vaughn

    --


    _______________________________________________
    rabbitmq-discuss mailing list
    rabbitmq-discuss at lists.rabbitmq.com
    https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110413/63ad40e6/attachment.htm>
  • Vaughn Vernon at Apr 13, 2011 at 2:59 pm
    Thanks much, Tim. That helps me make a decision. I always assign a
    message id so I can use message de-duplication at the subscriber side. I
    may use message command idempotence in some cases.

    Kind regards,

    Vaughn

    --
    On 4/13/2011 8:02 AM, Tim Fox wrote:
    RabbitMQ clients don't expose any sort of XA/JTA interface so
    enlisting a Rabbit local tx in a larger global XA tx won't be possible.

    You can probably find other ways to ensure atomicity by some kind of
    resend approach and detecting duplicates.
    On -10/01/37 20:59, Vaughn Vernon wrote:
    Hey,

    How do you recommend handling the case where a local application
    database transaction may commit or rollback, and you don't want to
    publish the event unless it commits? In other words:

    1 - application transaction begins
    2 - application writes to database
    3 - rmq message published (publish must succeed for application
    transaction to succeed)
    4 - application transaction commits; however, issue occurs,
    transaction does not complete; must prevent rmq publish

    Can't move #3 after #4 because the possibility exists that rmq
    publish will fail and message will never be published.

    This points to 2pc of application and rmq, but unavailable for the
    application database. BTW, does rmq 2pc with other databases?

    Vaughn

    --


    _______________________________________________
    rabbitmq-discuss mailing list
    rabbitmq-discuss at lists.rabbitmq.com
    https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss

    _______________________________________________
    rabbitmq-discuss mailing list
    rabbitmq-discuss at lists.rabbitmq.com
    https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110413/0fc4ff47/attachment.htm>

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprabbitmq-discuss @
categoriesrabbitmq
postedApr 12, '11 at 4:31a
activeApr 13, '11 at 2:59p
posts4
users2
websiterabbitmq.com
irc#rabbitmq

2 users in discussion

Vaughn Vernon: 3 posts Tim Fox: 1 post

People

Translate

site design / logo © 2022 Grokbase