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 » getting bytes ans Codepage of a Textmessage

Post new topic  Reply to topic
 getting bytes ans Codepage of a Textmessage « View previous topic :: View next topic » 
Author Message
ThomasT
PostPosted: Tue Apr 25, 2006 1:53 am    Post subject: getting bytes ans Codepage of a Textmessage Reply with quote

Novice

Joined: 23 Apr 2006
Posts: 12

Hallo!

How can I get the "raw" bytes of a JMSTextmessage?
There's a method _exportBody; but I couldn't found a documentation.

How can I read the Codepage. There's a protected field an with some hacks I could read read it, but what's the correct way?

Thank you for help.

Greetings Thomas
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Apr 25, 2006 2:59 am    Post subject: Reply with quote

Grand High Poobah

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

Can you be a little more specific about what you are trying to do and really why you are trying to do it? I have a feeling there is a much easier way but we don't know enough about your problem to help you with it.

_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mvic
PostPosted: Tue Apr 25, 2006 3:17 am    Post subject: Re: getting bytes ans Codepage of a Textmessage Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

ThomasT wrote:
How can I get the "raw" bytes of a JMSTextmessage?

Use MQGET in a C app. Is this different from the answer you were looking for? If so, it may help if you re-state the problem.

Quote:
How can I read the Codepage.

If this was written from JMS classes, this will probably be 819 or 1208, at a guess. But this is text, which can be extracted from the message using the suitable available Java methods. So, with fjb_saper, I am wondering Why?
Back to top
View user's profile Send private message
ThomasT
PostPosted: Tue Apr 25, 2006 3:53 am    Post subject: Reply with quote

Novice

Joined: 23 Apr 2006
Posts: 12

The conditions are:

Clientside: java, means jms, on different mashines (WinXP, Win2000, Unix)

Serverside: mq with xml-text as message. Textmessage.

Nothing more is really specified!

The best would be that the client is able to handle all kind of different incoming message. Even those which are actually wrong.
I noticed that there are no comprehensible correlation during codepage conversion. Sometimes even when the protected field codepage in JMSTextMessage says "UFT-8" theres no conversion from UFT-8 done.
But from cp1252 etc.pp.

I read the manuals but I didn't found the useful information.

You're right there would be another solution: using bytemessage, but the sender sets the Textmessage-flag. And its an political issue that this cannot be changed.
Back to top
View user's profile Send private message
briancop
PostPosted: Tue Apr 25, 2006 11:37 pm    Post subject: Reply with quote

Apprentice

Joined: 04 Apr 2005
Posts: 28
Location: Hursley, UK

If using Java you have 2 choices for MQ API - JMS or MQ Classes for Java. From the little we've seen of your requirements JMS is probably the right choice, but if you really need to get in and deal directly with individual MQ fields then MQ Classes for Java gives you a more direct access.

If using JMS Text Messages,
point 1 - don't even think about using the protected fields of the message classes. They are protected for a reason; they are subject to change release to release and for internal use only
point 2 - the idea of a Text Message is that it contains Text rather than raw bytes. When a producer app populates the Text Message they create a java String in whatever codepage suits them and pass it to JMS. JMS will then send it over WMQ in some form such that the textual content is preserved (e.g. in UTF-8 as a way of encoding any string regardless of original codepage), so that a consumer app can just get a java String and read the text from it in whatever codepage suits them. Java/JMS will handle whatever codepage conversions are required to do this
point 3 - as a result of 2, you shouldn't need to worry about the internal codepage that is used. If, for some reason, you do need to worry about it (e.g. because the producer was not a JMS app but was pretending to act like one and got it wrong) then MQ Classes for Java may be a better bet for you
Back to top
View user's profile Send private message
ThomasT
PostPosted: Wed Apr 26, 2006 7:34 am    Post subject: Reply with quote

Novice

Joined: 23 Apr 2006
Posts: 12

Hallo!

I'll look at the MQ Classes you mentioned.
Perhaps it helps.
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 » getting bytes ans Codepage of a Textmessage
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.