|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
can we transfer Java objects through MQ |
« View previous topic :: View next topic » |
Author |
Message
|
pg35581 |
Posted: Thu Jan 17, 2008 7:07 am Post subject: can we transfer Java objects through MQ |
|
|
Novice
Joined: 05 Nov 2007 Posts: 10 Location: India
|
Hi EveryOne,
whether we can transfer Java objects through MQ
for example: ByteArryOutputStream object
Thanks
Prashanth |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jan 17, 2008 7:12 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You can put a serialized Java object into the bitstream that is the data portion of an MQ message. A simple way of doing this is to use JMS and an JMSObjectMessage.
Java Objects are very very very very very unportable.
Please don't do this.
Please write your data as data, not as objects to your MQ messages. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
pg35581 |
Posted: Thu Jan 17, 2008 7:53 am Post subject: |
|
|
Novice
Joined: 05 Nov 2007 Posts: 10 Location: India
|
can u please suggest any other way without using JMS |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jan 17, 2008 7:56 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
pg35581 wrote: |
can u please suggest any other way without using JMS |
Convert the objects into data as suggested, and put the data with the API? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jan 17, 2008 7:59 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I just said that JMS made it simpler, I didn't say it was required.
Do you understand what a serialized Java Object is?
Do you understand how to write that to a bitstream?
Do you understand how to write anything to an MQ Message?
Again.
It is a very very very very bad idea to do this.
The only thing that will be able to read and unserialize this object is another object in the same JVM or another Java program, running on a compatible JVM level, that has the full necessary set of Java classes on the classpath, to fully unserialize this object.
Even if all you are doing is sending messages to yourself, it is much better to pass information as data than as objects when using MQ. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|