I'm using ActiveMQ (with Spring) for sending messages to remote OSGi-Container. This works very fine, but there is one issue.
I got two classes implementing Serializable. One class is the class member of the other class, like this:
public class Member implements Serializble {
private int someValue;
private static final long serialVersionUID = -4329617004242031635L;
... }
public class Parent implements Serializable {
private static final long serialVersionUID = -667242031635L;
private double otherValue;
private Member;
}
So, when is send a Parent instance, the Member of the Parent is null.
Hope you understand what my problem is :)
Edit: funny issue: I got a java.util.date in my class which is serialized correctly, but this is the only thing, all Doubles etc are null
Serialized objects in byte messages are a bit hard to deal with.
I would go with object messages, as Aksel Willgert suggested, or simply take it to some more loosley coupled format, such as serialzied XML. I quick solution would be to use XStream to go to/from XML in a more loosely coupled fashion, a quick guide here: XStream
Update, and some code here (need to add xstream-.jar to your project)
If Objects are an option, you might go for something like this
Producer side:
Consumer side: