6 Replies Latest reply on Dec 2, 2008 11:35 AM by Andy Taylor

    message expiry

    Andy Taylor Master

      Ive implemented a message expirer that basically iterates through each queue and expires any messages. The problem is that because I've used the iterator, which is fail fast, the method has to be synchronized on queue which is, as Tim correctly pointed out, not very scalable.

      An alternative would be be to use the getAll() method on the PriorityLinkedList, which basically makes a copy, and iterate through this. We would then only need to synchronize on removing any expired messages. If the message has been consumed since checking then we just ignore as the client will take care of expiring it.

      Another alternative would be to maintain another concurrentset of the messages and iterate over these instead.

      thoughts?