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 » IBM MQ Java / JMS » Writng an ObjectMessage, getting a BytesMessage

Post new topic  Reply to topic
 Writng an ObjectMessage, getting a BytesMessage « View previous topic :: View next topic » 
Author Message
sami2box
PostPosted: Wed Jul 08, 2009 5:59 am    Post subject: Writng an ObjectMessage, getting a BytesMessage Reply with quote

Newbie

Joined: 08 Jul 2009
Posts: 2

Hi All,

We are using Websphere ver 6.1 and MQ ver 6. After writing an ObjectMessage to a queue, the clients receive it as a BytesMessage. There are two different environments that one of them works fine with the same code and the other one makes this problem. I compared all the qcf and queue definitions between the two environments but everything is exactly the same.

Have you ever faced a problem like?

Thanks in advance.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jul 08, 2009 7:17 am    Post subject: Re: Writng an ObjectMessage, getting a BytesMessage Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

sami2box wrote:
Have you ever faced a problem like?


Using an Object Message is dubious. Unmarshall the object and send it as text.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jul 08, 2009 7:59 am    Post subject: Re: Writng an ObjectMessage, getting a BytesMessage Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

sami2box wrote:
Hi All,

We are using Websphere ver 6.1 and MQ ver 6. After writing an ObjectMessage to a queue, the clients receive it as a BytesMessage. There are two different environments that one of them works fine with the same code and the other one makes this problem. I compared all the qcf and queue definitions between the two environments but everything is exactly the same.

Have you ever faced a problem like?

Thanks in advance.

I doubt very much that both environments are the same.
What does the targetClient attribute say on the destinations?

If you have to deal with a BytesMessage and you KNOW that it should be an ObjectMessage you can allways try to put the bytes into a ByteArray and use the IO stream and buffer classes to get an ObjectInputStream from which to unmarshall your objects...

But the ideal solution is, as my esteemed colleague pointed out, to transform the object into XML and not use object messages. (One version of Java might have different marshalling properties as the other and you might not always be able to unmarshall the object...)

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
sami2box
PostPosted: Wed Jul 08, 2009 11:18 am    Post subject: Reply with quote

Newbie

Joined: 08 Jul 2009
Posts: 2

Thank you very much for your replies.

Unfortunately, we cannot do anything for the way that objects are sent to (or received from) the queues. There is a framework that everyone is using in this organization. So, I suppose either there is something with the versions/patches of our Websphere and/or MQ, or that, the queues are not defined exactly like what we used to have in the previous environments.

I will keep you updated as soon as I get to a conclusion.

Thanks again.
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 » IBM MQ Java / JMS » Writng an ObjectMessage, getting a BytesMessage
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.