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 July 24th, 2015, 09:06 AM
Registered User
 
Join Date: Jul 2015
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default NServicebus

First of all, fantastic book, really clears up a lot of concepts. Thank you!

Ive been playing around with the NServicebus example, and perhaps I am not understanding it correctly, as this is my first exposure to it, or maybe something is misconfigured. (I am using version 5.0, so there were some differences in config).

I have the example running correctly, with the MVC application creating an order and sending it to the OrderCreated handler, which than publishes an event that the PaymentAccepted module processes.

Now I am trying some scenarios just to get a feel for it:

If I leave the web application running, and shut down the OrderCreated and PaymentAccepted applications, I can still place an order! Great! No errors!

When I start up the OrderCreated, and PaymentAccepted applications, after placing several orders, it looks like OrderCreated will pick up and process whats in the queue, and publish the events, however, the PaymentAccepted module doesnt seem to hook it self up to listen to the event, until after these items have been processed -- thus missing all the events while the two modules were offline. Any new orders placed, while all 3 are up work fine going forward. Is this the accepted behaviour?

Another scenario is if I kill the OrderCreated module, place some orders, and start it back up again. Again, it processes the queue, but the PaymentsAccepted module does not know it has to re-attach it self to listen to the events, thus missing all future events until it is restarted. Is there a way around this -- short of restarting both?

Finally, in a production environment, would these Message Handlers typically reside in a windows service?

Thank you again! Sorry for all the questions!

Luke
 
Old July 24th, 2015, 01:50 PM
Wrox Author
 
Join Date: May 2015
Posts: 59
Thanks: 1
Thanked 5 Times in 5 Posts
Default

Hi Luke,

Questions are good, no worries about that. Please keep them coming if you have more. Also glad you liked the book. And even though you say you haven't used NSB, you seem to have a very firm grasp of messaging and SOA. You seem like a very quick learner.

You're absolutely right to query the behaviour you noticed. It's definitely not correct. As you seem to be aware, the main point of SOA/messaging/queues is to increase fault tolerance. Basically, the PaymentAccepted component/service should be getting those messages.

The publisher of those events knows that the PaymentAccepted component is a subscriber. Therefore, it should continue to try and publish the event until it succeeds, or after a certain number of times puts it on the error queue. You could try that - looking on the error queue. Let me know if it is there.

Alternatively, you could switch to the version of NSB used in the book and check it works on your machine. It could be some default configuration settings that have changed in versions.

In a production environment you would deploy as a Windows Service, but you would use the NSB self host: http://docs.particular.net/nserviceb...rvicebus-host/ that makes life a bit easier.

Speak soon
 
Old July 24th, 2015, 02:05 PM
Registered User
 
Join Date: Jul 2015
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you Nick, I will spend some time with it, and see what I find.
 
Old July 24th, 2015, 02:05 PM
Wrox Author
 
Join Date: May 2015
Posts: 59
Thanks: 1
Thanked 5 Times in 5 Posts
Default

I will try and test over the weekend too.









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