The current ActiveMQMessageAudit is implemented using synchronized blocks around an LRUCache implemented with a LinkedHashMap as an extension to the sync-free ActiveMQMessageAuditNoSync class.
Modern Java language collection (ConcurrentHashMap) and lock-free programming approach can improve performance (especially when there are concurrent producers). Both classes can be replaced with a single, modern implementation.
A modernized MessageAudit:
The current ActiveMQMessageAudit is implemented using synchronized blocks around an LRUCache implemented with a LinkedHashMap as an extension to the sync-free ActiveMQMessageAuditNoSync class.
Modern Java language collection (ConcurrentHashMap) and lock-free programming approach can improve performance (especially when there are concurrent producers). Both classes can be replaced with a single, modern implementation.
A modernized MessageAudit: