ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsetrak...@apache.org
Subject svn commit: r1664235 - /incubator/ignite/site/trunk/features.html
Date Thu, 05 Mar 2015 06:14:16 GMT
Author: dsetrakyan
Date: Thu Mar  5 06:14:16 2015
New Revision: 1664235

URL: http://svn.apache.org/r1664235
Log:
fixing features

Modified:
    incubator/ignite/site/trunk/features.html

Modified: incubator/ignite/site/trunk/features.html
URL: http://svn.apache.org/viewvc/incubator/ignite/site/trunk/features.html?rev=1664235&r1=1664234&r2=1664235&view=diff
==============================================================================
--- incubator/ignite/site/trunk/features.html (original)
+++ incubator/ignite/site/trunk/features.html Thu Mar  5 06:14:16 2015
@@ -538,12 +538,30 @@ under the License.
                 <div class="tab-content">
                     <div class="tab-pane active" id="messaging-example-ordered">
                         <pre class="brush:java">
-                            
+                            Ignite ignite = Ignition.ignite();
+
+                            IgniteMessaging rmtMsg = ignite.message(ignite.cluster().forRemotes());
+
+                            // Add listener for unordered messages on all remote nodes.
+                            rmtMsg.remoteListen("MyOrderedTopic", (nodeId, msg) -> {
+                                System.out.println("Received ordered message [msg=" + msg
+ ", from=" + nodeId + ']');
+
+                                return true; // Return true to continue listening.
+                            });
+
+                            // Send ordered messages to remote nodes.
+                            for (int i = 0; i < 10; i++)
+                                rmtMsg.sendOrdered("MyOrderedTopic", Integer.toString(i));
+                        </pre>                            
                     </div>
                     <div class="tab-pane" id="messaging-example-unordered">
                         <pre class="brush:java">
+                            Ignite ignite = Ignition.ignite();
+
+                            IgniteMessaging rmtMsg = ignite.message(ignite.cluster().forRemotes());
+
                             // Add listener for unordered messages on all remote nodes.
-                            ignite.message().remoteListen("MyUnOrderedTopic", (nodeId, msg)
-> {
+                            rmtMsg.remoteListen("MyUnOrderedTopic", (nodeId, msg) -> {
                                 System.out.println("Received unordered message [msg=" + msg
+ ", from=" + nodeId + ']');
 
                                 return true; // Return true to continue listening.
@@ -551,8 +569,7 @@ under the License.
 
                             // Send unordered messages to remote nodes.
                             for (int i = 0; i < 10; i++)
-                                ignite.message(ignite.cluster().forRemotes()).
-                                    send("MyUnOrderedTopic", Integer.toString(i));
+                                rmtMsg.send("MyUnOrderedTopic", Integer.toString(i));
                         </pre>
                     </div>
                 </div>



Mime
View raw message