I am working on a software solution for a group of applications running on the same server.
Applications are loosely coupled and share an event log. The problem we are facing is performance, in which each application calls the database every time they need to register an event.
What I'm trying to do is to separate the whole process by removing direct application calls to the database and routing them through a service running on the machine. The only goal is to handle events from multiple applications on the machine.

Ultimately, my goal is to implement some kind of system in the Event helper object, which will allow these objects to communicate directly with the Event service.
My first instinct was to use your typical โeventโ, but from the study, I realized that I cannot trigger an event in one process to process in another process.
As part of my research, I met Event Listening in another application and C # Win32 Messaging using SendMessage .
Sendmessage looks like a promising solution, but I wanted to be sure, so I talked to one of my colleagues who was close to the project (the original developer who was transferred to the new project before this was completed) and he gave additional information about the situation. They apparently tried to use WCF and create it as a web service. Perhaps this would work, except for the location and security level of the server itself.
He believes that it MAY be possible to implement a WCF system at the OS level without having to use it in a web service environment.
My question is ... "Is WCF used at OS level?" and "Which of the following options will be most effective in the scenario?" Bearing in mind that this MUST be untied, and applications cannot interact with the event log in the database itself.
WCF Update:
So, I started to put something together, and this is what I came up with.
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ServiceModel; using System.ServiceModel.Description; namespace SelfHost { [ServiceContract] public interface ISelfHostingService { [OperationContract] string SelfHost(string name); } public class SelfHostingService : ISelfHostingService { public string SelfHost(string name) { return string.Format("Hello, {0}", name); } } class Program { static void Main(string[] args) { Uri baseAddress = new Uri("http://localhost:8080/SelfHost"); ServiceHost host = new ServiceHost(typeof(SelfHostingService), baseAddress); host.AddServiceEndpoint(typeof(SelfHost.ISelfHostingService), new BasicHttpBinding(), baseAddress); host.Open(); Console.WriteLine("The service is ready at {0}", baseAddress); Console.WriteLine("Press <Enter> to stop the service."); Console.ReadLine(); } } }
But there's a problem. This line:
Uri baseAddress = new Uri("http://localhost:8080/SelfHost");
I guarantee that the server will not allow the service to register this local address (it has already been tried and it was a flop).
So, my new question ... "Is there a way that is not related to changing the configuration settings on the server itself?"
MSMQ Update:
This is indeed an option, but ... [pregnant pause] We use the message queue for other functions. My only hesitation is overhead. I would prefer it to be completely untied. I am looking for an application to solve applications. I would prefer the service to โlistenโ rather than get ready.
Finale
I did a lot more research, and I decided that using WCF was in my interest. As part of the Windows service, I plan to add app.config for the event logging service, and then configure the service to use named pipes on the local host.
thanks for the help
Follow-up
For anyone who may be interested. It works great. Net.pipe is active, and I can create events and send them to the service from several applications with little or no processing time.
The wcf service is enclosed in a very simple Windows service that simply opens a service pipe. on the client side, I was able to easily detect and implement the service. All I have to do is call the client class and show my events in real time in the database.
Thanks again.