Reputation: 1455
I have created a site to book meetings and now I need to create a service (possibly part of same project?) to check the database and see if there are any meetings taking place within the next hour. So it would have to run every 5 minutes or even 15 minutes.
If meetings are occurring in the next hour it will send an email to the stakeholders.
I don't really require code, just want a bit of a head-start and to know if I can use an ASMX Web Service or if there is a better way of doing this. It seems so far from all tutorials I have read through that Web Services just make functions available to be called.
Upvotes: 1
Views: 2030
Reputation: 1455
So I've decided to go with a Window Service that will use a timer to run every 30 minutes. It will perform a check for meetings that are occurring in an hours time and send a notification out (email).
To install it I am using the Installutil tool via command prompt.
Here is a tutorial that helped me. Develop/Install windows service
Upvotes: 0
Reputation: 41
A web service isn't needed unless you plan on having your clients (web/mobile/windows) call the service to check what meetings are coming up in the next hour or if your app/job that checks for meetings calls the web service to handle the sending of emails. If you were trying to do a push notification to your clients (web/mobile/windows) instead of a pull, then you would want to use something like WebSockets to keep a connection open to a server and have the server push notifications back to the client when new meetings are available. As the above indicates, like you clued in on, web services provide the ability to call a "function" (model) remotely/out of process.
To schedule something that will run within the app and continually check the database for new meetings or meetings that are now within the 1 hour mark you could use a scheduler like @stuartd suggested. Then at the end of the job, send emails.
If you need to go bigger with more decoupling you could have a job that simply watches the data for meetings that are new/within the period of time you need. Instead of that job sending the email, you could have a messaging system, like Kafka, running that you send these messages to. At that point you setup a simple app that would read the message from the messaging system to process it and send emails. This is no doubt a larger design and implementation, however it will give you more flexibility with regards to the workflow flexibility, scaling out, and the use of the messaging for other things.
Upvotes: 1