Recently I was asked the following in a Interview:
There is a process/application A which is constantly getting messages every 5 Minutes (Assume)
The requirement is that there is a process/application B which needs the messages to be transferred from A.
But process/application A should make sure that the message has actually been received by process/application B.
The interviewer wanted to know how can this be implemented in C#. Can we use Serialization here?
From my understanding the best way this can be done is using message queue or pipe mechanism.
Anything that involves sending messages between processes (or, generally, even between AppDomains in a single process) has to use serialization of some kind, as ultimately the data needs to be mapped down to something that can traverse process spaces, and a “Message” is, by definition, serialized data. This serialization could be explicit or implicit (automatic, perhaps by a proxy/stub layer – although I’d prefer not).
In reality, Process/Application A cannot “make sure” that it has been delivered, since it can’t enforce that the second process is running. It can, however, have some kind of callback confirmation message perhaps. A transactional message queue isn’t unreasonable, but that only ensures that it gets queued – it doesn’t ensure that it gets processed (ever). Personally, I’d see if a socket would be sufficient, first.