Posted: Thu Aug 28, 2003 3:54 am Post subject: Error while Receiving the message from local queue using JMS
Novice
Joined: 22 Aug 2003 Posts: 12
Hi
I am facing problems while receiving the message from local queue. i have MQ Series 5.2 setup on windows and running this code on the same machine using JMS :
The error i am getting is :
================================================================================
The attempt to read the message back again failed, apparently because it wasn't
there
javax.jms.JMSException: Failed to get message back again
at QReceiver1.main(QReceiver1.java:43)
===============================================
But i have two messages in my local queue ?
Here is the outline of my code which i am using to retrieve the message from queue :
+++++++++++++++++++++++++++++++++++++++++++++++
public static void main(String args[])
{
try
{
String factoryName="QCF2";
String queueName="Q3";
// Check to see if the receive call has actually returned a
// message. If it hasn't, report this and throw an exception...
if( inMessage == null ) {
System.out.println( "The attempt to read the message back again " +
"failed, apparently because it wasn't there");
throw new JMSException("Failed to get message back again");
}
// Extract the message content with getText()
String replyString = ((TextMessage) inMessage).getText();
throw new JMSException("Retrieved the wrong type of message");
}
// Closing QueueReceiver
queueReceiver.close();
I am Good. How r u doing. i have physically 2 messages in the queue.
I am not able to trace where is the problem.
Is my code ok. or i need to add some other method.
I am stucked.
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