-
15. Losing messages on the subscriber when filtering
java1970 May 12, 2011 5:08 PM (in response to java1970)For now seemed to have fixed my problem with a HornetQ code change.
It's probably not the best (or even correct solution), but I'd like to post it here as maybe a lead to what the correct solution would be.
I think it's coming down to a threading issue in the BindingsImpl.getNextBinding method.
My logging showed some threading issues within this method, so on a whim I added synchronized to this method.
I ran my tests again and all the consumers received every correct message
private synchronized Binding getNextBinding(final ServerMessage message,
final SimpleString routingName,
final List<Binding> bindings)
-
16. Losing messages on the subscriber when filtering
clebert.suconic May 12, 2011 6:10 PM (in response to java1970)Hmmm... ok.. I will take a look on this asap...
-
17. Losing messages on the subscriber when filtering
clebert.suconic May 13, 2011 2:22 AM (in response to clebert.suconic)If there's a problem here, it's around adding and removing consumers with filters too fast, what is leading to some races.
If you just open a consumer (and leave it, as you're supposed to), the filter is working fine.
I'm not saying it shouldn't work. I'm just saying this is an edgy case, which I need to investigate. It's not like something basic as filters are broken.
-
18. Re: Losing messages on the subscriber when filtering
timfox May 13, 2011 2:37 AM (in response to clebert.suconic)I'm not saying it's causing the problem but the test program is buggy - it's keeping counters of messages sent/received in one thread and updating them from another.
If you want to do this use an AtomicInteger or careful use of volatile.
And use a CountDownLatch to wait for messages.... sleeping and checking non synchronized ints across threads, is *horrible*
-
19. Losing messages on the subscriber when filtering
java1970 May 16, 2011 11:44 PM (in response to clebert.suconic)Hi Clebert,
I know you're busy with other issues, but just curious if you've been able to investigate the issue any.
The change I made works good for us where HornetQ is concerned, but still not sure if it's the correct change.
We have also implemented the use of temp queues and we are loadtesting that as well.
Thanks
-
20. Losing messages on the subscriber when filtering
clebert.suconic May 17, 2011 1:56 AM (in response to java1970)The issue is about removing and adding consumers with filters concurrently. So your fix is probably correct.
I didn't look at this today as you seemed to be taken care of for now, and I had another fix. I will have it looked soon.
if you could create the JIRA.
-
21. Re: Losing messages on the subscriber when filtering
clebert.suconic May 17, 2011 10:25 PM (in response to clebert.suconic)Are you sure you are using the latest release? I bet you have an issue with versioning...
I have added a test, ran your test and I couldn't replicate anything.
I had fixed issues with temporary queues. So, I bet you are not running the correct version.
If you want to check the test I added, look at http://anonsvn.jboss.org/repos/hornetq/branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/TemporaryQueueTest.java (testTemoraryQueuesWithFilter)
I'm also attaching the TopicTest to run in loop.
So, at this point I can't find an issue with the latest version on Branch_2_2_EAP