Search code examples
javac++jmsmessagingqpid

Apache Qpid/Redhat MRG - Send dates in a portable way across different systems


Apache qpid does not has a direct support for sending Date type objects. I want to send datetime fetched from Database and Date objects using Apache Qpid in way that is portable across different systems i.e. systems using C++/Java or any other language using Apache qpid.

How can I do this so that all the usual stuff like timezone resolution etc are taken care w/o any issues.


Solution

  • I always use a UTC timestamp (in Java this is a long) which is the number of milliseconds since the big bang, or perhaps something slightly more recent. At any rate, that is a universal value which can then be rendered back into a date type object and the timezone will be faithfully rendered in accordance with the locale of the environment rendering it.