Ah, you could also use distributed locks to represent ownership, and events to get informed when a node leaves, without blocking a thread indefinitely until the lock is released. There are many possibilities.
*Raúl Kripalani* PMC & Committer @ Apache Ignite, Apache Camel | Integration, Big Data and Messaging Engineer http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani http://blog.raulkr.net | twitter: @raulvk On Thu, Jan 7, 2016 at 12:32 PM, Raul Kripalani <[email protected]> wrote: > Take into account that Ignite topics, by nature, are a broadcast channel, > which means that all nodes subscribed to topic XYZ will receive a copy of > the event. > > Having said that, you could synchronise multiple nodes to ensure only a > single one is subscribed to a given topic at any point in time, by using a > Distributed CountDown Latch, or some other similar coordination mechanism > to make potential subscribers compete during a failover. > > You do need to think about your QoS and delivery guarantees. If a message > is sent during a brief period where no nodes are subscribed, the message > would be lost. Another possibility would be to use an Ignite Queue + > [Distributed Countdown Latch + Atomic Counter] for coordination. Queues > would accumulate unconsumed messages until a node takes them. > > Or as Valentin said, use the compute API. > > Regards, > > *Raúl Kripalani* > PMC & Committer @ Apache Ignite, Apache Camel | Integration, Big Data and > Messaging Engineer > http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani > http://blog.raulkr.net | twitter: @raulvk > > On Thu, Jan 7, 2016 at 12:11 PM, kcheng.mvp <[email protected]> wrote: > >> My use case is below. >> >> >> *Node-A* and *Node-B* would send message with topic 'Topic-Happy' >> >> *Node-C* and *Node-D* subscribe this topic 'Topic-Happy' >> >> >> no matter *Node-A* or *Node-B* send a message with topic 'Topic-Happy', >> *make sure only one node* (Node-C or Node-D) could consume this message >> >> >> How to achieve this? If there is a way, does this way is smart enough for >> loading balance? >> >> >> >> >> >> >> -- >> View this message in context: >> http://apache-ignite-users.70518.x6.nabble.com/Point-to-point-messaging-with-Ignite-tp1191p2420.html >> Sent from the Apache Ignite Users mailing list archive at Nabble.com. >> > >
