سؤال

I recently took Udi's Advanced SOA course and am at what was described as Phase 1 of Introducing SOA.

We have a number of Windows Services that I am starting to replace. One of those services polls an email address (email used as an interface by an external system we have to integrate with) and sometimes when we can't process an email we receive, the service sends an email to a user to let them know something needs to be done.

What I'm not quite sure about is the best way to replace this. The solution I am leaning towards would just be to replace it with (initially) a single process that is installed as a Windows Service using the NServiceBus Host. This would do the polling as the Windows Service currently does, and in exceptional circumstances would send an InvalidEmailReceived message (one way, fire and forget) via NServiceBus to a handler that can send the user notification email.

The other option I considered, but doesn't feel right, would be to leave the Windows Service as is, but setup a NServiceBus ref for send only. And then create a separate NServiceBus Host process that exists solely to handle the InvalidEmailReceived messages sent from the existing (but modified) Windows Service.

All encouragement/criticism greatly appreciated...

هل كانت مفيدة؟

المحلول

your first solution makes sense, you can deploy the NServiceBus host as a windows service have a saga that starts when the process starts, to do the polling using timeouts.

You can deploy another component (in the same process initially) 'emailSender' that receives a command to send a notification to the user and executes it.

Take a look at Andreas's post http://andreasohlund.net/2012/06/07/sending-emails-using-nservicebus/

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top