-
1. Re: Queue Messages are not listed in QueueBrowser when in 'w
adrian.brock Dec 7, 2005 8:12 AM (in response to upankar)http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossHelp
Asked so many times before. -
2. Re: Queue Messages are not listed in QueueBrowser when in 'w
upankar Dec 7, 2005 5:23 PM (in response to upankar)Sorry.. but i still dont find the answer in the help link.. My specific question is ....
Is there a way to view the scheduled messages ( i.e. scheduled for redelivery) ?
Because i could see that anything that is not acked by the MDB in CLIENT_ACK mode increases the scheduledMessageCount by 1 while decrementing the QueueDepth by 1. And since standard queue browser is not picking up scheduled items when i attempt to browse the queue, is there any other way to view them ?
Could you help point me to exact answer ? -
3. Re: Queue Messages are not listed in QueueBrowser when in 'w
adrian.brock Dec 7, 2005 8:34 PM (in response to upankar)"upankar" wrote:
Could you help point me to exact answer ?
No, because I am not a search engine. I gave you a link to the search engines. -
4. Re: Queue Messages are not listed in QueueBrowser when in 'w
adrian.brock Dec 7, 2005 8:37 PM (in response to upankar)I can tell you I remember a similar question was asked within the last month.
Go find it. -
5. Re: Queue Messages are not listed in QueueBrowser when in 'w
shafieksavahl Dec 11, 2005 12:44 AM (in response to upankar)Hello upankar
I was the one who posted a similar question last month and after much searching I was unable to find a solution to my problem. I was told that there might be a patch, but I am unable to find it. Not sure if you have to have a subscription to access it. I did find a reference to a post made a couple of years ago, but have not seen any solutions. I have been thinking about creating my own patch, but have been waiting to see if others have a better solution.
I have been thinking about adding code to the browse method of the BasicQueue.
public SpyMessage[] browse(String selector) throws JMSException {
.
.
.
SpyMessage [] list ....
for (Iterator i = events.keySet().iterator(); i.hasNext(); ) {
MessageReference message = (MessageReference)iter.next();
list[XXX] = message.hardReference; // may need to do a clone here
}
return list;
}
Some feedback would be great.
All I havve to do now is to figure out how to compille up my changes.
Thanks
Shafiek -
6. Re: Queue Messages are not listed in QueueBrowser when in 'w
shafieksavahl Dec 11, 2005 6:01 PM (in response to upankar)Hi upankar
I hgave tried the following code in BasicQueue.java and it seems to work. Not sure of the implications in a clustered environment. Still to add some thread safe locks if necessary.public SpyMessage[] browse(String selector) throws JMSException { if (selector == null) { SpyMessage list[]; synchronized (messages) { list = new SpyMessage[messages.size() + events.size()]; Iterator iter = messages.iterator(); int i = 0; for (; iter.hasNext(); i++) list = ((MessageReference) iter.next()).getMessageForDelivery(); Iterator eventsIter = events.keySet().iterator(); for(; eventsIter.hasNext(); i++) { list = ((MessageReference) eventsIter.next()).getMessageForDelivery(); } } return list; } else { Selector s = new Selector(selector); LinkedList selection = new LinkedList(); synchronized (messages) { Iterator i = messages.iterator(); while (i.hasNext()) { MessageReference m = (MessageReference) i.next(); if (s.test(m.getHeaders())) selection.add(m.getMessageForDelivery()); } } SpyMessage list[]; list = new SpyMessage[selection.size()]; list = (SpyMessage[]) selection.toArray(list); return list; } }
Shafiek -
7. Re: Queue Messages are not listed in QueueBrowser when in 'w
upankar Dec 12, 2005 1:57 AM (in response to upankar)Thanks for your answer. I do appreciate. But i have some apprehensions modifying the source code - I think Jboss controlls all code changes , patch etc, and doing on our own probably might not be legal.
Hence, we have implemented a work-around. When we need re-delivery, we add the message back to queue as a new new one with a property called STATUS and value as REDELIVER. Another property called REDELIVERY_TIME is set which is equal to = current time (in milliseconds) + redelivery delay. Then, we start a sychronous consumer thread which runs every sometime and looks for items with status RETRY and REDELIVERY_TIME <= current time ( uses message selector). The main MDB is modified to use a message selector for items with status PENDING. This way, MDB doesnt get RETRY status items. -
8. Re: Queue Messages are not listed in QueueBrowser when in 'w
adrian.brock Dec 14, 2005 3:11 AM (in response to upankar)"upankar" wrote:
Thanks for your answer. I do appreciate. But i have some apprehensions modifying the source code - I think Jboss controlls all code changes , patch etc, and doing on our own probably might not be legal.
Truly the blind leading the blind. :-)
Yes, JBoss Inc. and its employess own the copyright to about 70-80% of the codebase
but we license it to everybody to distribute AND MODIFY under the LGPL.
Unlike some other licenses, you don't need the LGPL to USE the software. -
9. Re: Queue Messages are not listed in QueueBrowser when in 'w
adrian.brock Dec 14, 2005 3:14 AM (in response to upankar)Other "blindness"
* Not reading the spec to understand what is guaranteed behaviour and avoid writing
non-portable code (practically nothing is guaranteed if you have active listeners on a queue you are trying to browse concurrently)
* Using selectors on Queues (I am bored of repeating myself already)
* etc. -
10. Re: Queue Messages are not listed in QueueBrowser when in 'w
adrian.brock Dec 14, 2005 3:16 AM (in response to upankar)Another one.
"MDB in CLIENT_ACK"
Explain how you use client acknowledgement with an MDB?
There is no such configuaration! -
11. Re: Queue Messages are not listed in QueueBrowser when in 'w
adrian.brock Dec 14, 2005 3:20 AM (in response to upankar)And the real FAQ of this thread is browsing scheduled messages
and claiming a BUG
If you can show me where in the spec it even mentioned scheduled messages
and their behavour I will gladly concede this is a bug.
Going back to the LGPL comment.
The code for scheduled messages was contributed by a non JBoss employee.
He obviously didn't have a need for browsing scheduled messages since he
didn't add code for it.
So your choices are simple;
* Add the code yourself and keep it to yourself
* Add the code yourself and contribute it back for others to use
* Raise a feature request and wait for somebody else to do it for you -
12. Re: Queue Messages are not listed in QueueBrowser when in 'w
adrian.brock Dec 14, 2005 3:28 AM (in response to upankar)And the final FAQ is CLIENT_ACK and browsers.
If you receive under CLIENT_ACK, the message belongs to session
NOT the QUEUE. So it is invisible to any browser.