I would like to have possibilities like ConcurrentMap gives me so:
- thread-safe
- performance-efficient
- Id indicator as a key
- object in a value
- random-access to specific elements
And additionally, I would like to keep the order in which the messages are stored. Do anyone know which structure could fulfil the requirements or should I write my own implementation? Maybe anyone knows any useful library for such a problem?
I thought about ConcurrentNavigableMap as it is an extension of SortedMap. However, as I understand it well it will sort the elements in a specific order, not keep the order of inserting. I would also avoid having any BlockingQueue or BlockingDeque as I would like to have random access to specific elements.
I really appreciate your help.