Yep, although this is not a message-oriented pattern, but rather a RPC call
and an implementation of the "Command Message" integration pattern.

I was under the impression that the OP wanted to send message/data across,
not necessarily invoke a discrete action per message type...

@kcheng – when I mention Distributed CountDownLatch, AtomicCounter and
Locks, I mean that you could implement a coordination algorithm based on
such data structures, e.g. the first node to acquire a named lock becomes
the consumer. The rest remain listening for an event that the master
consumer disappeared, and compete to acquire the lock and become the master
consumer. You could implement this algorithm in many manners, also using
latches and counters.

*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 1:04 PM, Denis Magda <[email protected]> wrote:

> In my opinion the best way to implement your scenario is to leverage
> Ignite Compute API.
> The reason is that the API guarantees delivery of compute tasks,
> fault-tolerance and uses load balancing to spread tasks among available
> nodes.
>
> The pseudo-code looks like this
>
> // Start the nodes that should receive tasks/messages by marking them with 
> 'receiver' flag.IgniteConfiguration cfg = new IgniteConfiguration();
>
> HashMap<String, Object> attrs = new HashMap<>();
> attrs.put("receiver", true);
>
> cfg.setUserAttributes(attrs);
>
> ignite = Ignition.start(cfg);
>
> // On sender nodes' side create a cluster group that will contain only the 
> nodes with this attr being set.ClusterGroup group = 
> ignite.cluster().forAttribute("receiver", true);
> // Task will be executed only on one node from the group. Which one node will 
> be taken depends on a load balancer and whether a node is alive or 
> not.ignite.compute(group).call(new IgniteCallable<Object>() {
>     @Override public Object call() throws Exception {
>         // Execution logic.    }
> });
>
>
> --
> Denis
>
>
> On 1/7/2016 3:36 PM, kcheng.mvp wrote:
>
> Thank you very much!
>
>
> I am going to use Ignite Queue  implement this.
>
>
> but you mentioned that* Ignite Queue + [Distributed Countdown Latch + Atomic
> Counter] *
>
>
> why need *Distributed Countdown Latch * or* Atomic Counte* here ? As once an
> entry item from poll from the queue, then other node can not get the same
> entry item.
>
>
>
> --
> View this message in context: 
> http://apache-ignite-users.70518.x6.nabble.com/Point-to-point-messaging-with-Ignite-tp1191p2426.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>
>
>

Reply via email to