From: Venkateshwar B. <vbo...@el...> - 2002-09-06 17:29:35
|
I am having problem with CLIENT_ACKNOWLEDGE option for JBOSS JMS implementation. As soon as I read messages from a queue using the above option while creating QueueReceiver from QueueSession, they disappear from queue like they read with AUTO Acknowledge option. What I am missing? Following is the code snippet i am using... session =3D conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE); conn.start(); QueueSender send =3D session.createSender(que); for (int i =3D 0; i < 5; i++) { TextMessage tm =3D session.createTextMessage(); tm.setText(text+i); send.send(tm); } send.close(); session =3D conn.createQueueSession(false, QueueSession.CLIENT_ACKNOWLEDGE); QueueReceiver recv =3D session.createReceiver(que); for (int i =3D 0; i < 5; i++) { TextMessage mesg =3D (TextMessage) recv.receive(10); if (mesg !=3D null){ System.out.println("message recvd:" + mesg.getText()); } else { System.out.println("no message found"); break; } } ////>>>>>>>>>>>>> i dont see any messages in QUEUE, at this point of time... recv.close(); |