Wrox Programmer Forums
BOOK: Patterns, Principles and Practices of Domain-Driven Design
This is the forum to discuss the Wrox book Patterns, Principles and Practices of Domain-Driven Design by Scott Millett; ISBN: 978-1-118-71470-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Patterns, Principles and Practices of Domain-Driven Design section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old December 9th, 2015, 04:52 PM
Registered User
Join Date: Dec 2015
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Message Gateway

In page 212 is detailed the implementation of message gateway, in order to divide the message in 2. One to process the payment and another one to continue the message avoiding to charge the credit card twice.

But what happens if the message fails after accepting the payment but before sending the message to the bus (like the bus endpoint went down) ? It will change the credit card but will be retried again after the bus goes up again.

Is this scenario possible ?
Old February 11th, 2016, 05:11 PM
Wrox Author
Join Date: May 2015
Posts: 59
Thanks: 1
Thanked 5 Times in 5 Posts

Hello and thankyou for your question.

Firstly, my apologies for the delay. There is an issue with the Wrox notification system and I was not being notified of new messages.

As for your question. In short yes, there is always the possibility that there could be a failure at any point. By adding a message after each operation, you reduce the potential for a failure to cause harm.

But, there's always that small chance it will happen at an awkward moment. The strategy here is to minimise the possibility as much as possible.

As we talked about in the book, though. If you can make your operations idempotent the problem goes away. If you REALLY REALLY REALLY cannot tolerate failure, you may want to investigate distributed locking as described by Martin Kleppmann http://martin.kleppmann.com/2016/02/...d-locking.html.

Hope that helps and I hope the late response does not cause offence.

Similar Threads
Thread Thread Starter Forum Replies Last Post
SMS Gateway carolynjoseph Java Databases 3 October 11th, 2012 08:27 AM
sms gateway KnightErrant ASP.NET 2.0 Professional 1 October 11th, 2012 08:12 AM
paypal payment gateway. myself.panku ASP.NET 3.5 Professionals 0 July 30th, 2009 01:09 AM
SMS through Gateway gmdotcom2004 ASP.NET 1.0 and 1.1 Basics 1 January 3rd, 2007 09:30 AM
gateway address suresh_rupineni VBScript 0 July 27th, 2006 09:26 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.