We have been thinking recently about integrating our J2EE system with other applications written in Python/Perl. Our application integrates very nice with other Java systems over JMS. Is it possible that non-java systems will receive Serializable messages and do some modification on it (at some level every class property is java primitive type)? Also we would like to do it in the other direction, e.g. python application constructs object which then will be sent over JMS and modified (at least understandable) by our java app. Do you have any experience in this topic / hints for us?
Thanks in advance,
Piotr
You don’t want to use Serializeable objects for this. You’ll need a more portable format, such as a text based format like XML or JSON or CSV. It’s simply not worth the effort to try and read serialized java object on other platforms.
Now you could use another binary format, such as the Google format (protocol buffers I think it’s called). You can also change your java classes, specifically the ones that you plan to exchange, and you can implement the Externalizable interface. This let’s you have full control over the reading and writing of your java classes. That way you can still use the java serialization protocol and workflow, but write and read a more portable format.
This let’s you incrementally add support for the Python system without really disturbing the rest of the system, especially for messaging, as long as there are no legacy messages to be processed in your queues when you switch over.