I am currently writing a distributed system using hazelcast. I have a few questions regarding Queues implemented using hazelcast.
Any input or advice on this matter would be greatly appreciated.
Thanks
The capacity of a Queue is the number of elements the Queue can hold. As elements are added to a Queue, the capacity is automatically increased as required through reallocation.
Data in Hazelcast is usually stored in-memory (RAM) so that it's faster to access. However, data in RAM is volatile, meaning that when one or more members shut down, their data is lost. When you persist data on disk, members can load it upon a restart and continue to operate as usual.
A continuous queue is a JMS queue with a message-driven bean (MDB) as a consumer. A continuous queue is predefined for enterprise services only and uses multi-threaded processing to provide better system performance.
Hazelcast distributes map entries onto multiple cluster members (JVMs). Each member holds some portion of the data. Distributed maps have one backup by default. If a member goes down, your data is recovered using the backups in the cluster.
There is no other way at the moment. So you will have your threads on each node calling queue.take(). Hazelcast team is planning to add IQueue.addQueueConsumer(QueueConsumer) that will behave similar to JMS MessageListener
You are right. Adding listeners is not good way of doing it as it is very expensive operation. You might want to create an issue for this at http://code.google.com/p/hazelcast/issues. It is surely nice to have feature.
-talip @ hazelcast
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With