JMS - Managing unacknowledged messages: buggy behaviour

Hi,

I'm experiencing a pretty weird situation accesing to a JMS queue. I have two messages in a queue (let's say they have IDs A and B). For each step I describe below, I use a Session.CLIENT_ACKNOWLEDGE but I don't acknowledge after read them (I want them to stay in the queue).

1. List the message with QueueReceiver without selector -> OK (A,B)

2. Access Message A with QueueReceiver with selector (JMSMessageID=A) -> OK

3. Access Message B with QueueReceiver with selector (JMSMessageID=B) -> ERROR!!! (Why does it fail?)

4. Access Message A with QueueReceiver with selector (JMSMessageID=A) -> ERROR!!! (It worked in step 2!)

5. Access Message B with QueueReceiver with selector (JMSMessageID=B) -> OK (this is the step failed in 3)

6. List the message with QueueReceiver without selector -> OK (B,A) Notice that the order has changed!

From this point, it works always in the same way ...

Is there anything I'm doing wrong? Am I missing something important? I'd really appreciatte any help with this problem. It's becoming a pain in my project.

Thanks in advance

Jorge Ortiz

P.S: BTW, I'm using Sun ONE 8 JMS queues.

[1225 byte] By [jortizclaver] at [2007-11-26 8:24:20]
# 1
I forgot to include an step between 3 and 4: 3.5 List the message with QueueReceiver without selector -> OK (A,B)
jortizclaver at 2007-7-6 21:35:18 > top of Java-index,Application & Integration Servers,Sun Java System Message Queue...
# 2

there is a bug in the product which causes selectors with messageID not to work (I'm not sure why the first case worked)

bugid 6196233

It has been fixed in the release of MQ which should be released with AS 8.1

If you are seeing the problem with 8.1, please start the broker manually and send me the version number:

imqbrokerd -version

Linda_Schneider at 2007-7-6 21:35:18 > top of Java-index,Application & Integration Servers,Sun Java System Message Queue...
# 3

Lisa,

Thanks a lot for your reply.

Yes, I'm experimenting that problem too. I solved it using the workaround proposed in the bug report. That's why the first step works.

I found out how to make all this stuff work. I was using the QueueReceiver and rollback for simulating a read-only access. It was easy to implement because the code was exactly the same no mutter the read-only flag. Now, I have to detect the read-only flag and if it's set I create a QueueBrowser instead of a QueueReceiver. Working in that way I don't loss the reference to any message.

Thanks,

Jorge

jortizclaver at 2007-7-6 21:35:18 > top of Java-index,Application & Integration Servers,Sun Java System Message Queue...