I am in the process of implementing a protocol based on an RFC written in my lab. I intend to use Java to run the simulations. I don't think I can use object serialization to pass around messages because I want the messages to be interoperable with other systems implemented in other languages, which I think is not possible using serialization.
What feature can I use in Java to be able to talk to nodes implemented in a different language?
Also, there are about 50 different types of messages that can be sent and received each having a different structure.
Ex: hello, bye, register etc.
Each message contains some information that is needed to be processed. I plan to implement each message type as a class in Java.
What is the cleanest way possible to figure out at the receiving node's end what type of message was sent by the sending node?
Ex: How would I as a receiver know that a node who sent me a message just now wants to register with me?
I'll be grateful if I could get suggestions on some good design patterns.