-
1. Re: Newb Question - How to send objects in message payload
ashish_rajhans Mar 1, 2007 6:02 AM (in response to hmrizin)Hi,
I am quoting some lines from the ProgrammersGuide - Might help U. -
More complex content may be added through the add method, which supports named Objects. Names must be unique on behalf of a given Message or an appropriate exception will be thrown. Using <name, Object> pairs allows for a finer granularity of data access. The type of Objects that can be added to the Body can be arbitrary: they do not need to be Java Serializable. However, in the case where non-Serializable Objects are added, it is necessary to provide JBossESB with the ability to marshal/unmarshal the Message when it flows across the network.
See the section of Message Formats for more details.
Note:Caution: we discourage the general use of Serialized Java objects in
messages because it constrains the service implementations. Use with
care.
In general you will find it easier to work with the Message Body through the namedObject approach. You can add, remove and inspect individual data items within the Message payload without having to decode the entire Body. Furthermore, you can combine named Objects within the payload with the byte array.
Ashish -
2. Re: Newb Question - How to send objects in message payload
hmrizin Mar 1, 2007 6:26 AM (in response to hmrizin)Thank you Ashish
The problem was because the javabean which I was trying to add to the message payload didn implement the Serializable interface.
Now I have changed the javabean to implement Serializable interface and it works fine.
Riyaz