Results 1 to 2 of 2
- 12-08-2011, 06:40 PM #1
Member
- Join Date
- Apr 2011
- Posts
- 12
- Rep Power
- 0
JMS: Which type of message to use to transfer objects?
Hello,
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?
Thanks.
- 12-09-2011, 01:38 PM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
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.
Similar Threads
-
Transfer int to string type problem!
By mjzhaochenyi in forum New To JavaReplies: 1Last Post: 10-02-2011, 05:27 PM -
JAXBElement is a raw type message
By BobswYourUcle in forum New To JavaReplies: 1Last Post: 04-11-2011, 09:49 PM -
IE not reply type 3 NTLM message
By seritzo in forum Advanced JavaReplies: 0Last Post: 01-22-2010, 02:40 PM -
Error Message:Editor does not contain a main type
By Deepa in forum New To JavaReplies: 0Last Post: 11-27-2008, 12:25 PM -
File and Message transfer over sockets!
By rameshraj in forum NetworkingReplies: 3Last Post: 05-14-2008, 08:13 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks