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 » international characters corrupted

Post new topic  Reply to topic
 international characters corrupted « View previous topic :: View next topic » 
Author Message
spasco
PostPosted: Wed Aug 20, 2003 2:25 pm    Post subject: international characters corrupted Reply with quote

Newbie

Joined: 23 Jul 2003
Posts: 4
Location: North Hollywood

Upon retrieving a message off our queue which contains international characters (canadian) we've noted that the message gets corrupted, garbled. Below is an example of a test message and the code used to extract the message off the queue. Does anyone know what I should be doing to have MQ properly interprete international characters?


Thank you,
Stephen Pasco

<message>
<last_name>Dôutée</last_name>
</message>


try {
boolean status = true;
MQEnvironment.hostname = (String)table.get("hostname");
MQEnvironment.channel = (String)table.get("channel");
MQEnvironment.port = Integer.parseInt((String)table.get("port"));
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES);
MQQueueManager qMgr = new MQQueueManager((String)table.get("queuemanager"));
// Options that control the opening of the queue.
int openOptions = MQC.MQOO_INQUIRE + MQC.MQOO_BROWSE + MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_INPUT_SHARED;
// Now specify the queue that we wish to open, and the open options...
MQQueue queue = qMgr.accessQueue((String)table.get("queue"), openOptions);
int depth = queue.getCurrentDepth();

// Set the get message options...
MQGetMessageOptions gmo = new MQGetMessageOptions(); //accept the defaults
gmo.options = MQC.MQGMO_SYNCPOINT_IF_PERSISTENT + MQC.MQGMO_NO_WAIT + MQC.MQGMO_FAIL_IF_QUIESCING;
String message;

int count = 1;
while (true && status == true) {
MQMessage retrievedMessage = new MQMessage();
try {
queue.get(retrievedMessage, gmo);
int length = retrievedMessage.getMessageLength();
message = retrievedMessage.readString(length);
System.out.println("the message = " + message);
}
catch(Exception e) {
qMgr.backout();
logger.error("Exception", e);
break;
}
}
queue.close();
qMgr.disconnect();
}
catch (MQException e) {
logger.error("MQException", e);
}
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
leongor
PostPosted: Thu Aug 21, 2003 5:15 am    Post subject: Reply with quote

Master

Joined: 13 May 2002
Posts: 264
Location: Israel

Quote:
// Set the get message options...
MQGetMessageOptions gmo = new MQGetMessageOptions(); //accept the defaults
gmo.options = MQC.MQGMO_SYNCPOINT_IF_PERSISTENT + MQC.MQGMO_NO_WAIT + MQC.MQGMO_FAIL_IF_QUIESCING;

Add MQC.MQGMO_CONVERT to gmo.options
_________________
Regards.
Leonid.

IBM Certified MQSeries Specialist.
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 » international characters corrupted
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.