Venkateshwar,
I looked in 'Java Message Service' from O'Reilly and it seems
that messages will be removed from the queue if the JMS provider believes
the message was delivered successfully.
When you invoke message.acknowledge() you are actually ACK'ing
all non-ACKed received messages to that point, not just the single message
(according to the book).

I would suggest invoking session.recover() to see if the messages on the
queue are redelivered while in CLIENT_ACKNOWLEDGE mode.  This should
re-deliver the 5 messages.
In AUTO mode, it should not send anything. (at least that is
the theory...)

Good luck,
- Mike

-----Original Message-----
From: Venkateshwar Bommineni [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 06, 2002 4:08 PM
To: [EMAIL PROTECTED]
Subject: RE: [JBoss-user] JMS client acknowledgement


Mike,
 I am not using any explicit persistent messaging. Its default JBOSS
mechanism (i guess its file based).
 And i am able to get the messages without any problem. Issue is without
ACK (mesg.acknowledge() method )also they are disappearing from queue as
AUTO_ACK. So basically I dont see any difference btw AUTO and CLIENT
ACKNOWLEDGE features.




-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 06, 2002 3:40 PM
To: [EMAIL PROTECTED]
Subject: RE: [JBoss-user] JMS client acknowledgement


Are you using persistent messaging?
If you are not, messages which have no current receivers are discarded.
Your example code shows this.
Try placing the sender and receiver code in different threads and run
them
concurrently.

I would also set your receiver timeout a bit longer or your receive loop
may
exit before your sending is complete.

- Mike

Mike Hewitt
Software Engineer
Northrop Grumman IT


-----Original Message-----
From: Venkateshwar Bommineni [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 06, 2002 1:29 PM
To: [EMAIL PROTECTED]
Subject: [JBoss-user] JMS client acknowledgement



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 = conn.createQueueSession(false,
QueueSession.AUTO_ACKNOWLEDGE);
        conn.start();
        QueueSender send = session.createSender(que);
        for (int i = 0; i < 5; i++) {
            TextMessage tm = session.createTextMessage();
            tm.setText(text+i);
            send.send(tm);
        }
        send.close();

        session = conn.createQueueSession(false,
QueueSession.CLIENT_ACKNOWLEDGE);
        QueueReceiver recv = session.createReceiver(que);
        for (int i = 0; i < 5; i++) {
            TextMessage mesg = (TextMessage) recv.receive(10);
            if (mesg != 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();


-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to