Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

unable to receive object message

 
Ambika Jain
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am unable to read the ObjectMessage at the receiving end.

--------------------code for sending object message-------
:
msg = ses.createObjectMessage();
File f = new File("C:/My/Work/SunMQ/P4");
msg.setObject(f);

msgPro.send(ses.createMessage());
:
---------------------------------------------------------
--------------------code for receiving object message----
:
while(true){
Message m = msgCons.receive();
System.out.println(" 1a" + m.getJMSMessageID());
if ( m instanceof ObjectMessage){ // my message doesn't get inside this loop

File f = (File) m;
System.out.println(" Message receive ");

}else { break; }
}
:
---------------------------------------------------------
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic