Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 24th, 2015, 09:06 AM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
Reply With Quote
  #2 (permalink)  
Old July 24th, 2015, 01:50 PM
Wrox Author
Points: 237, Level: 4
Points: 237, Level: 4 Points: 237, Level: 4 Points: 237, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
Reply With Quote
  #3 (permalink)  
Old July 24th, 2015, 02:05 PM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.
Reply With Quote
  #4 (permalink)  
Old July 24th, 2015, 02:05 PM
Wrox Author
Points: 237, Level: 4
Points: 237, Level: 4 Points: 237, Level: 4 Points: 237, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2015
Posts: 59
Thanks: 1
Thanked 5 Times in 5 Posts
Default

I will try and test over the weekend too.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off




All times are GMT -4. The time now is 09:19 PM.


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