nojyarg
asked on
jms_bytes message type - trying to decode message body...
i'm receiving a message from MQ - it originated on a mainframe. the message as it reads in my onMessage is this:
JMS Message class: jms_bytes
JMSType: null
JMSDeliveryMode: 2
JMSExpiration: 0
JMSPriority: 0
JMSMessageID: ID:c3e2d840d4d8f1d74040404 040404040b cd3a02452f 62407
JMSTimestamp: 1112884972650
JMSCorrelationID:null
JMSDestination: null
JMSReplyTo: null
JMSRedelivered: false
JMSXDeliveryCount:1
JMS_IBM_MsgType:8
JMSXAppID:JDONTHF
JMS_IBM_Format:
JMS_IBM_Encoding:785
JMS_IBM_PutApplType:2
JMS_IBM_Character_Set:37
JMSXUserID:jdon
JMS_IBM_PutTime:14425265
JMS_IBM_PutDate:20050407
Integer encoding: 1, Floating point encoding 768
e3c1d3c8d6d3c45c5c5c5c5c5c 5c5c5cf0f0 f2f0f0f0f1 f44c849485 a2a2818785 6ef0f1f2f1 4c84
888581846e4c849683a3a89785 c9846e8896 9384899587 408685854c 61849683a3 a89785c984 6e4c
a296a4998385c9846e94818995 8699819485 4c61a296a4 998385c984 6e4c869699 9481a3c984 6e86
89a785846093859587a38840a3 85a7a34c61 8696999481 a3c9846e4c 6184888581 846ef0f0f9 f44c
848496834085a7a38599958193 c49683c984 7e7fc8c6f0 f0f0f7f1c2 c2f5f2f0f0 f5f0f6f1f2 7f40
85a7a38599958193e58599a289 9695c9847e 7f868999a2 a3409596a3 8983857f6e 4c5abac3c4 c1e3
c1ba40404040404040f0f0f2f4 c4c8c6f0f0 f0f7f1c2c2 f5f2f0f0f5 f0f6f1f2e8 f0f3f0f5c8 e7e8
e940c1c4e5c5d9e3c9e2c9d5c7 4040404040 4040404040 4040404040 4040404040 40f1f2f340 e64b
40f1f8e3c840e2e3d9c5c5e340 4040404040 4040404040 40d5c5e640 e8d6d9d26b 40d5e840f1 f0f0
f0f94040404040404040404040 4040404040 4040404040 4040404040 4040404040 4040404040 4040
...
I've tried to decode the darn thing w/ASCII, UTF8, Unicode, IBM437...
BytesMessage tmpMsg = (BytesMessage)message
int writeIndex = 0;
byte[] buffer = new byte[2048];
byte[] body = new byte[0];
while (true)
{
int numBytesRead = tmpMsg.readBytes(buffer);
if (numBytesRead == -1)
{
break;
}
byte[] tmp = new byte[body.length + numBytesRead];
System.arraycopy(body,0,tm p,0,body.l ength);
System.arraycopy(buffer,0, tmp,body.l ength,numB ytesRead);
body = tmp;
} //end while
String msgBody = new String(body, "<encoding>");
no dice. i get a garbage string every time. can anyone shed some light? thanks!
JMS Message class: jms_bytes
JMSType: null
JMSDeliveryMode: 2
JMSExpiration: 0
JMSPriority: 0
JMSMessageID: ID:c3e2d840d4d8f1d74040404
JMSTimestamp: 1112884972650
JMSCorrelationID:null
JMSDestination: null
JMSReplyTo: null
JMSRedelivered: false
JMSXDeliveryCount:1
JMS_IBM_MsgType:8
JMSXAppID:JDONTHF
JMS_IBM_Format:
JMS_IBM_Encoding:785
JMS_IBM_PutApplType:2
JMS_IBM_Character_Set:37
JMSXUserID:jdon
JMS_IBM_PutTime:14425265
JMS_IBM_PutDate:20050407
Integer encoding: 1, Floating point encoding 768
e3c1d3c8d6d3c45c5c5c5c5c5c
888581846e4c849683a3a89785
a296a4998385c9846e94818995
89a785846093859587a38840a3
848496834085a7a38599958193
85a7a38599958193e58599a289
c1ba40404040404040f0f0f2f4
e940c1c4e5c5d9e3c9e2c9d5c7
40f1f8e3c840e2e3d9c5c5e340
f0f94040404040404040404040
...
I've tried to decode the darn thing w/ASCII, UTF8, Unicode, IBM437...
BytesMessage tmpMsg = (BytesMessage)message
int writeIndex = 0;
byte[] buffer = new byte[2048];
byte[] body = new byte[0];
while (true)
{
int numBytesRead = tmpMsg.readBytes(buffer);
if (numBytesRead == -1)
{
break;
}
byte[] tmp = new byte[body.length + numBytesRead];
System.arraycopy(body,0,tm
System.arraycopy(buffer,0,
body = tmp;
} //end while
String msgBody = new String(body, "<encoding>");
no dice. i get a garbage string every time. can anyone shed some light? thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Believe me, it took a while to find, and I had a pretty good idea of what I was looking for.
Jim
Jim
ASKER