Author |
Message
|
techno |
Posted: Tue Apr 08, 2003 10:49 am Post subject: ObjectMessage equivalent |
|
|
Chevalier
Joined: 22 Jan 2003 Posts: 429
|
How is JMS's ObjectMessage is interpreted in the implemented application using another language. ie, A Java client sending an ObjectMessage to an MQ application. This MQ application is not written in Java, but in Cobol or C. How does this application interpret sent ObjectMessage?
Thanks
Shiva. |
|
Back to top |
|
 |
vennela |
Posted: Tue Apr 08, 2003 12:11 pm Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Shiva:
Do you mean a JMS client or a MQ Base Java client?
If you are talking about JMS app, in the MQSeries Java manual, chapter 12, there is a section "Mapping JMS to a native MQSeries application".
-------
Venny |
|
Back to top |
|
 |
techno |
Posted: Tue Apr 08, 2003 1:29 pm Post subject: |
|
|
Chevalier
Joined: 22 Jan 2003 Posts: 429
|
JMS Client App Sending ObjectMessage. Where as the reader program is in C/Cobol. This receiver program receives the message and now how does it interpret ObjectMessage? |
|
Back to top |
|
 |
techno |
Posted: Tue Apr 08, 2003 1:53 pm Post subject: |
|
|
Chevalier
Joined: 22 Jan 2003 Posts: 429
|
Adding to above message,
I went through that manual and they have not given exactly how does native application interpret the message. They gave something related to header mapping.
Thanks for your help
Shiva. |
|
Back to top |
|
 |
vennela |
Posted: Tue Apr 08, 2003 2:21 pm Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Are you asking if "JMS app PUTs a message containing characters, then would C app interpret them as characters or bytes or something esle" |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Apr 09, 2003 5:41 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
If you put a message on a queue that contains a Java object, I believe the data in that message will be binary data, and possibly packed in various ways. In addition, it would contain the java byte codes for the object methods as well as just the 'data'.
Any program that tried to read that message would have to understand how Java objects are encoded in order to be able to understand the data. I don't recommend trying to do this from COBOL or C.
If you want to share data between Java programs and non-java programs, the best way is to serialize the java object into some sort of text data, either an XML structure or something that can be interpreted by a COBOL copybook or a C structure. The Castor framework will allow you to transform Java objects into XML and vice versa. |
|
Back to top |
|
 |
techno |
Posted: Wed Apr 09, 2003 1:11 pm Post subject: |
|
|
Chevalier
Joined: 22 Jan 2003 Posts: 429
|
Thank you. That answers my question.
Shiva. |
|
Back to top |
|
 |
tingwen |
Posted: Fri Dec 23, 2005 3:52 pm Post subject: |
|
|
Novice
Joined: 19 Aug 2005 Posts: 24
|
....If you want to share data between Java programs and non-java programs, the best way is to serialize the java object into some sort of text data, either an XML structure or something that can be interpreted by a COBOL copybook or a C structure. The Castor framework will allow you to transform Java objects into XML and vice versa......
if the data contains binary (like PDF, or picture), is java-serialization-to-XML-structure still the best approach?
wen |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Dec 23, 2005 4:29 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
If the data is already a well known binary format, then it's not a Java object in the first place. So it wouldn't be put using an Object message. Likely it would either be put as a TextMessage with XML and binary data that has been base64 encoded, or as a BytesMessage with the raw binary data stream.
Regardless, without something like Message Broker in between two applications, both applications have to know the format of the message on the wire and be able to deal with it. Or at least, they both have to be able to deal with the message without corrupting it - like one is a specific app sending out business data, and the other is a general purpose queue-to-file program that just writes the bytes out without knowing what they are. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|