Hi, I'm looking for demonstration code showing the use of caching and threading in ISS EventSinks in managed code (C# 2.0) I have an eventsink which works fine but I want some help with how it can work on multiple threads as it will be running under heavy load. The sink implements IMailTransportSubmission, and OnMessageSubmission does the actual work. If we also implement IEventIsCacheable then send a lot of emails through the server at the same time, the EventSink is only created once (we log this in the constructor). I think this is bad because even though IIS may be using 10 threads, there is only one EventSink object, so it is a bottleneck. If we do NOT implement IEventIsCacheable then we can see that the EventSink is created for EVERY email that goes through the server. I don't think this is good either, because the cost of creating the Sink every time is high. It uses a SQL connection etc. So what is the most scalable way to build the eventsink? Can we build it so that each thread in IIS creates one instance of the eventsink, and re-uses that for every email that thread processes? Alternatively, maybe we should have a pool of eventsinks that can be used by IIS? I'm looking for information first, and then source code to demonstrate. Thanks!
1) Complete and fully-functional demonstration source code, and instructions for installation after building. 2) No installer needed thanks! 3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
Windows Server 2003 IIS 6 Exchange is NOT installed on the target server