|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
international characters corrupted |
« View previous topic :: View next topic » |
Author |
Message
|
spasco |
Posted: Wed Aug 20, 2003 2:25 pm Post subject: international characters corrupted |
|
|
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 |
|
 |
leongor |
Posted: Thu Aug 21, 2003 5:15 am Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
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
|
|
|
|