ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » can we transfer Java objects through MQ

Post new topic  Reply to topic
 can we transfer Java objects through MQ « View previous topic :: View next topic » 
Author Message
pg35581
PostPosted: Thu Jan 17, 2008 7:07 am    Post subject: can we transfer Java objects through MQ Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Thu Jan 17, 2008 7:12 am    Post subject: Reply with quote

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
View user's profile Send private message
pg35581
PostPosted: Thu Jan 17, 2008 7:53 am    Post subject: Reply with quote

Novice

Joined: 05 Nov 2007
Posts: 10
Location: India

can u please suggest any other way without using JMS
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Jan 17, 2008 7:56 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Thu Jan 17, 2008 7:59 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » can we transfer Java objects through MQ
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.