I am writing a generic SDK in which i am planning to use Protobuf (due to its advantages). I would have a generic header message as below
class Header
{
string Id;
Datetime Timestamp;
string ProcessName; //This is the Process in my server
string SessionID;
}
Now this message ideally would be inherited by an Application Message and write their own message. A pseudo code of the Application message would be
class Application : Header
{
string AppId;
string Message;
}
Now the implementation would be as below
Application appobj = new Application();
appobj.Id = "1";
appobj.Timestamp = DateTime.Now();
appobj.ProcessName = "ApplicationLog";
appobj.SessionId = "aaa-ee-rr"; //Guid
appobj.AppId = "App Logger";
appobj.Message = "Database";
Ideally when i get the message i would be only getting Application class proto (internally inheriting Header), the proto definition of which will not be present with me, as different applications would have their own proto. The server application would only have the proto message of the Header, which it should read and redirect to different Processes running on the server depending on the "Process Name".
Another consideration is the different processes are in c# but couple in Python. I saw both the protobuf-csharp-port and the Protbuf-net version (written by different people) and understood that for variety of programming languages being involved it is better to use the csharp-port than Protobuf-net version.
I have searched a lot on Stackoverflow and on the net, but i am unable to find a solution of getting the Header information from the application message without knowing the Application message proto (I only know Header proto which is inherited by the application).