If I have many queues and each has an unique ID, would a Hashtable of Queues be the way to go? I know it sounds strange that I'm asking this, but just wondering if there might be a better way for optimization.
Sorry for the lack of information. I'm basically storing queues of messages which are identified by the client id. The client will request to get messages from the server. In the case when the ack does not reach the server, the message still remains in the queue until the client makes another attempt to get the oldest message. The idea is to retain all the messages if the client fails to ack and to retrieve all messages in a FIFO manner.
Hashtableor aHashmapwill depend on the need of concurrent access. If you need to concurrency using aConcurrentHashMapwould be a better choice IMO.