can't remove messages while consuming messages on the same queue.
cjiras May 9, 2011 6:02 AMI'm using jboss 6.0.0.Final (with the embedded hornetq 2.1.2.Final).
I can produce and consume ObjectMessages without any problems on myQueue through the jboss container.
I can removeMessages on myQueue with a selector using the JMSQueueControl without any probems as long as I don't have a messageBean listening to myQueue. As soon as I startup jboss with a messageBean listening to myQueue I can't removeMessages on myQueue (it comes back a 0 removed though I know I have plenty messages in the queue that I can remove).
This is also true when I go through the JBoss JMX Management console.
I can get a list of messages (using the listMessageAsJSON operation) and remove messages (using removeMessages operation) as long as I don't have a messageBean listening to myQueue. As soon as a messageBean is configured to listen to the queue OR if I start up a client messageListener to consume message from myQueue, I can no longer removeMessages or list messages through the JMX Management console.
It seems that I might need to configure something with hornetq or my messageBean to allow me removeMessages and consume message on the same queue. Note: I did set my messageBean's maxSession to 1.
Inside the JMX console, when ConsumerCount=0, I can remove messages. When ConsumerCount=1 (or more), I can't remove messages.
For example:
1) I produce 40 messages onto MyQueue.
2) I have no consumers running.
3) I go to the JMX console and I can see all the messages on MyQueue.
4) I can list all the messages with the JMX operation listMessagesAsJSON.
5) I can remove a message with a filer using the JMX operation removeMessages (the removeMessages operation returns with result of 1).
6) I can verify that the message was removed by listing the messages again with listMessagesAsJSON.
7) I startup a MessageListener client and it begins to consume messages (about one every five minutes).
8) I go back to the JMX console and try to list all the messages with the JMX operation listMessagesAsJSON, but an empty array is returned.
9) I try to remove a message with a filter using the JMX operation removeMessages, but the operation returns a result of 0).
10) I then shutdown the client MessageListener.
11) I can now list all the messages with the JMX operation listMessagesAsJSON.
12) I can now remove a message with a filer using the JMX operation removeMessages.
When I connect a messageListener, is seems to block all QueueController requests.
Is this the expected default behavior?
I've done minimal custom setup with basic "out of the box" configurations for both the queue and messagebeans.
Basically, it seems to me that I should be able to connect a client messageListener AND be able to removeMessages via QueueController on the same queue at the same time without having to shutdown the client messageListener first to remove specific messages.
Any ideas...