Make a common architecture and interface, so you can replace the main transport.
public interface INotificationService { event EventHandler NewNotification; void SendEvent(string eventDetails); }
As a very simple example.
The implementation, well, you have several (hundreds) options. You note that events are placed in the database. If you guarantee a unique, increasing integer key, you can query the database from each client for any events> the last event identifier. Do this every 10 seconds or as soon as you can leave. This is a very minor performance hit, but not as effective, but very simple and reliable, and you already have access to the database because you host events there.
Alternatively, you can create a web service or a WCF service. The web service should usually be polled, the WCF service can be configured using duplex messages, so you wonβt need to be polled.
Other options include MSMQ or one of the other messaging solutions, RabbitMQ, Tibco, what ever. It all depends on the details.
It is important to make sure that you have this initial interface and code, if your database query is getting too slow and you need to switch to Tibco, this is a very localized simple change.
source share