JMS: Which type of message to use to transfer objects?
OK I've been googling all the way, but I sitll don't understand which message type I should use, e.g. MapMessage is said to be for primitive Java types only? That means I can't transfer my class objects with it? I need to transfer an instance of a class object let's say, I created a line class which contains 4 point values and I need to transfer than variable through the message, how do I do that? ObjectMessage seems to do some serialization thing what I probably don't need? So it's no good for me? BytesMessage ? Should I use that? But I need to cast my variable to bytes first and then unpack somehow? :S
Can anybody help?
Re: JMS: Which type of message to use to transfer objects?
You want your class to be Serializable, and then use the ObjectMessage.
Serialisation is simply a way of turning an object into bytes that can be streamed (ie to a file or database or something) and can then be deserialised back into a copy of the original object.