Hazelcast Queue Information

I am currently writing a distributed system using hazelcast. I have a few questions regarding Queues implemented using hazelcast.

  • What is the best way to process data from a queue? Currently, I have threads in each "node" that reads the lock queue while processing data. Is this correct or is there some kind of class that I don't know about that takes care of this, like JMS or messageListener?
  • I see that there is a time-to-live-second parameter that will remove the entry from the expired queue. My question is ... is there a way to detect the removal of an expired item from the queue? I know that there are Listeners, but this does not help, since it works on all the "nodes", and not just on one. I am looking for a way to execute code for each expired message (looks like a dead letter queue).

Any material or advice on this subject is welcome.

thanks

+6
source share
1 answer
  • There is currently no other way. This way you will have your threads in every node call queue.take (). The Hazelcast team plans to add IQueue.addQueueConsumer (QueueConsumer), which will behave similarly to the JMS MessageListener

  • You're right. Adding listeners is not the best way to do this, as it is a very expensive operation. You might want to create a problem for this at http://code.google.com/p/hazelcast/issues . Of course it's nice to have a feature.

-talip @hazelcast

+9
source

Source: https://habr.com/ru/post/907468/


All Articles