|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Extract text from message (image included) |
« View previous topic :: View next topic » |
Author |
Message
|
fredand44 |
Posted: Wed Feb 22, 2006 4:11 am Post subject: Extract text from message (image included) |
|
|
Acolyte
Joined: 14 Feb 2006 Posts: 63
|
Hello!
Our former thread about this is so messy now so we started this new one.
We still have problems with extracting the text from the TextMessage.
We send the message like this from a JSP-page in WAS:
TextMessage textMessage = queueSession.createTextMessage();
textMessage.setText(messageText);
setWSProps(textMessage);
jmsQueueSendManager.send( properties.getProperty("squeue"), textMessage);
System.out.println("Class name: " + textMessage.getClass().getName());
System.out.println("The message\n" + textMessage);
When we send the message we also set theses properties:
public void setWSProps(Message message)
{
try
{
message.setIntProperty("JMS_IBM_Encoding", 273);
//message.setIntProperty("JMS_IBM_MsgType", 0);
message.setIntProperty("JMS_IBM_PutApplType", 31);
message.setStringProperty("JMS_IBM_Format", "MQSTR");
message.setIntProperty("JMS_IBM_Character_Set", 1208);
}
catch(Exception e)
{
e.printStackTrace();
}
}
The new properties does not seem to do anything, so I guess we can remove it??
From the JSP-page we send this string "1140605792567" (System.currentTimeMillis())
When we send the message we get this output:
[2006-02-22 12:36:21:282 CET] 00000045 ConnectionFac W J2CA0294W: Deprecated usage of direct JNDI lookup of resource jms/WSQueueFactory. The following default values are used: [Resource-ref settings]
res-auth: 1 (APPLICATION)
res-isolation-level: 0 (TRANSACTION_NONE)
res-sharing-scope: true (SHAREABLE)
loginConfigurationName: null
loginConfigProperties: null
[Other attributes]
res-resolution-control: 999 (undefined)
isCMP1_x: false (not CMP1.x)
isJMS: false (not JMS)
[2006-02-22 12:36:21:298 CET] 00000045 SystemOut O Class name: com.ibm.ws.sib.api.jms.impl.JmsTextMessageImpl
[2006-02-22 12:36:21:298 CET] 00000045 SystemOut O The message
JMSMessage class: jms_text
JMSType: null
JMSDeliveryMode: 2
JMSExpiration: 0
JMSPriority: 4
JMSMessageID: ID:82d1f223d6c6b39287fca77e110a134f0000000000000001
JMSTimestamp: 1140608181282
JMSCorrelationID: null
JMSDestination: queue://DToQ?busName=WSBus&readAhead=AlwaysOn
JMSReplyTo: null
JMSRedelivered: false
JMS_IBM_Encoding: 273
JMSXUserID:
JMS_IBM_PutApplType: 31
JMS_IBM_Format: MQSTR
JMSXAppID: Service Integration Bus
JMS_IBM_Character_Set: 1208
1140605792567
[2006-02-22 12:36:21:298 CET] 00000045 SystemOut O Send completed
We receive the message from an other JSP-page like:
try
{
Message message = jmsQueueReceiveManager.receiveNoWait( properties.getProperty("rqueue") );
if (message != null)
{
System.out.println("Class name: " + message.getClass().getName());
if(message instanceof com.ibm.ws.sib.api.jms.impl.JmsTextMessageImpl)
{
messageText = ((com.ibm.ws.sib.api.jms.impl.JmsTextMessageImpl)message).getText();
}
else if (message instanceof BytesMessage)
{
byte[] bytes = new byte[20];
((BytesMessage)message).readBytes(bytes);
messageText = new String(bytes);
}
else if (message instanceof MapMessage)
{
messageText = (String) ((MapMessage)message).getObject("messageString");
}
else if (message instanceof ObjectMessage)
{
messageText = (String) ((ObjectMessage)message).getObject();
}
else if (message instanceof StreamMessage)
{
messageText = ((StreamMessage)message).readString();
}
else if (message instanceof TextMessage)
{
messageText = ((TextMessage)message).getText();
}
}
else
{
messageText = "Received nothing! (Message null)";
}
System.out.println("The message:\n" + message);
System.out.println("The text:\n" + messageText);
jmsQueueReceiveManager.close();
jmsQueueReceiveManager.terminate();
}
catch(Exception e)
{
e.printStackTrace();
}
The total output from the receiving side is
[2006-02-22 12:43:01:747 CET] 00000033 ConnectionFac W J2CA0294W: Deprecated usage of direct JNDI lookup of resource jms/WSQueueFactory. The following default values are used: [Resource-ref settings]
res-auth: 1 (APPLICATION)
res-isolation-level: 0 (TRANSACTION_NONE)
res-sharing-scope: true (SHAREABLE)
loginConfigurationName: null
loginConfigProperties: null
[Other attributes]
res-resolution-control: 999 (undefined)
isCMP1_x: false (not CMP1.x)
isJMS: false (not JMS)
[2006-02-22 12:43:01:904 CET] 00000033 SystemOut O Class name: com.ibm.ws.sib.api.jms.impl.JmsTextMessageImpl
[2006-02-22 12:43:01:904 CET] 00000033 SystemOut O com.ibm.ws.sib.api.jms.impl.JmsTextMessageImpl
[2006-02-22 12:43:01:904 CET] 00000033 SystemOut O The message:
JMSMessage class: jms_text
JMSType: null
JMSDeliveryMode: 2
JMSExpiration: 0
JMSPriority: 4
JMSMessageID: ID:82d1f223d6c6b39287fca77e110a134f0000000000000001
JMSTimestamp: 1140608181028
JMSCorrelationID: null
JMSDestination: queue://QTOD?busName=WSBus&readAhead=AlwaysOn
JMSReplyTo: null
JMSRedelivered: false
JMS_IBM_Encoding: 273
JMS_IBM_System_MessageID: BC73EA21F0444ABE_12500010
JMS_IBM_MsgType: 0
JMSXUserID:
JMS_IBM_PutTime: 11362128
JMS_IBM_PutApplType: 31
JMS_IBM_Format: MQSTR
JMS_IBM_PutDate: 20060222
JMSXAppID: Service Integration Bus
JMSXDeliveryCount: 1
JMS_IBM_Character_Set: 1208
[2006-02-22 12:43:01:904 CET] 00000033 SystemOut O The text:
[2006-02-22 12:43:01:904 CET] 00000033 SystemOut O Exception For input string: ""
As you can see the payload seems to be gone???
We got this overview image at this url:
http://www.dsv.su.se/~fr-ander/images/Overview.jpg
We send to the queue in WAS: jms/WSQueue
Down to the queue in MQ: MQToWL
MQToWL is a remote queue, everything put here gets sent back to the WAS: jms/WSQueue2
Somewhere the text in the message gets removed or encoded. So if any one know how to solve this please let us know.
How do we extract the message????
Any explanation is also welcome!
Best regards
Fredrik |
|
Back to top |
|
 |
mvic |
Posted: Wed Feb 22, 2006 4:19 am Post subject: Re: Extract text from message (image included) |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
fredand44 wrote: |
Somewhere the text in the message gets removed or encoded. |
It sounds like you think there is a defect in MQ or WAS. Did you call IBM Support and report it so they can look into it? They will probably ask for traces, etc. as described at the MustGather pages.
Quote: |
Any explanation is also welcome! |
Are you at latest fixpacks etc.? It would not be good for you (and us) to spend effort chasing a problem that is fixed already  |
|
Back to top |
|
 |
fredand44 |
Posted: Wed Feb 22, 2006 4:47 am Post subject: |
|
|
Acolyte
Joined: 14 Feb 2006 Posts: 63
|
Hello!
Actually I do not think there is any error with either WebSphere Application Server 6.0 (trail) or WebSphere MQ 6.0 (trial). We have just recently downloaded them.
We have just installed the fixpack:
6.0.0-WS-WAS-WinIA32-FP0000003.zip
With this output:
Success: The following product was successfully upgraded:
IBM WebSphere Application Server - C:\Program Files\IBM\WebSphere\AppServer
The following maintenance package was installed:
FP6003 - WebSphere Application Server
Click Finish to exit the wizard.
Correct me if I'm wrong when I say that this is all fixpacks needed??
HEY WAIT A MINUTE!!!!!!!
IT IS WORKING!!!!!!!
THE FIXPACK SOLVED IT!!!!!!
I WOULD NEVER THOUGT THAT IT DEPENDED ON A BUGG!!!!
Hmm TextMessage works fine, the other types does not work so fine!
But now we are back on track!!!
Best regards
Fredrik |
|
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
|
|
|
|