blob: fd55eb280f507f4e2f625c334bdf2642aadd9e29 [file] [log] [blame]
<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Interface IMessaging
| Apache Ignite.NET </title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Interface IMessaging
| Apache Ignite.NET ">
<meta name="generator" content="docfx 2.58.4.0">
<link rel="shortcut icon" href="../images/favicon.ico">
<link rel="stylesheet" href="../styles/docfx.vendor.css">
<link rel="stylesheet" href="../styles/docfx.css">
<link rel="stylesheet" href="../styles/main.css">
<meta property="docfx:navrel" content="../toc.html">
<meta property="docfx:tocrel" content="toc.html">
<meta property="docfx:rel" content="../">
</head>
<body data-spy="scroll" data-target="#affix" data-offset="120">
<div id="wrapper">
<header>
<nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../index.html">
<img id="logo" class="svg" src="../images/logo_ignite_32_32.png" alt="">
</a>
</div>
<div class="collapse navbar-collapse" id="navbar">
<form class="navbar-form navbar-right" role="search" id="search">
<div class="form-group">
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
</div>
</form>
</div>
</div>
</nav>
<div class="subnav navbar navbar-default">
<div class="container hide-when-search" id="breadcrumb">
<ul class="breadcrumb">
<li></li>
</ul>
</div>
</div>
</header>
<div class="container body-content">
<div id="search-results">
<div class="search-list">Search Results for <span></span></div>
<div class="sr-items">
<p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
</div>
<ul id="pagination" data-first="First" data-prev="Previous" data-next="Next" data-last="Last"></ul>
</div>
</div>
<div role="main" class="container body-content hide-when-search">
<div class="sidenav hide-when-search">
<a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
<div class="sidetoggle collapse" id="sidetoggle">
<div id="sidetoc"></div>
</div>
</div>
<div class="article row grid-right">
<div class="col-md-10">
<article class="content wrap" id="_content" data-uid="Apache.Ignite.Core.Messaging.IMessaging">
<h1 id="Apache_Ignite_Core_Messaging_IMessaging" data-uid="Apache.Ignite.Core.Messaging.IMessaging" class="text-break">Interface IMessaging
</h1>
<div class="markdown level0 summary"><p>Provides functionality for topic-based message exchange among nodes defined by <a class="xref" href="Apache.Ignite.Core.Cluster.IClusterGroup.html">IClusterGroup</a>.
Users can send ordered and unordered messages to various topics. Note that same topic name
cannot be reused between ordered and unordered messages.
<p>
All members are thread-safe and may be used concurrently from multiple threads.</p>
</div>
<div class="markdown level0 conceptual"></div>
<h6><strong>Namespace</strong>: <a class="xref" href="Apache.Ignite.Core.Messaging.html">Apache.Ignite.Core.Messaging</a></h6>
<h6><strong>Assembly</strong>: Apache.Ignite.Core.dll</h6>
<h5 id="Apache_Ignite_Core_Messaging_IMessaging_syntax">Syntax</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public interface IMessaging</code></pre>
</div>
<h3 id="properties">Properties
</h3>
<a id="Apache_Ignite_Core_Messaging_IMessaging_ClusterGroup_" data-uid="Apache.Ignite.Core.Messaging.IMessaging.ClusterGroup*"></a>
<h4 id="Apache_Ignite_Core_Messaging_IMessaging_ClusterGroup" data-uid="Apache.Ignite.Core.Messaging.IMessaging.ClusterGroup">ClusterGroup</h4>
<div class="markdown level1 summary"><p>Gets the cluster group to which this instance belongs.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">IClusterGroup ClusterGroup { get; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Apache.Ignite.Core.Cluster.IClusterGroup.html">IClusterGroup</a></td>
<td></td>
</tr>
</tbody>
</table>
<h3 id="methods">Methods
</h3>
<a id="Apache_Ignite_Core_Messaging_IMessaging_LocalListen_" data-uid="Apache.Ignite.Core.Messaging.IMessaging.LocalListen*"></a>
<h4 id="Apache_Ignite_Core_Messaging_IMessaging_LocalListen__1_Apache_Ignite_Core_Messaging_IMessageListener___0__System_Object_" data-uid="Apache.Ignite.Core.Messaging.IMessaging.LocalListen``1(Apache.Ignite.Core.Messaging.IMessageListener{``0},System.Object)">LocalListen&lt;T&gt;(IMessageListener&lt;T&gt;, Object)</h4>
<div class="markdown level1 summary"><p>Adds local listener for given topic on local node only. This listener will be notified whenever any
node within the cluster group will send a message for a given topic to this node. Local listen
subscription will happen regardless of whether local node belongs to this cluster group or not.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">void LocalListen&lt;T&gt;(IMessageListener&lt;T&gt; listener, object topic = null)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Apache.Ignite.Core.Messaging.IMessageListener-1.html">IMessageListener</a>&lt;T&gt;</td>
<td><span class="parametername">listener</span></td>
<td><p>Predicate that is called on each received message. If predicate returns false,
then it will be unsubscribed from any further notifications.</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Object</span></td>
<td><span class="parametername">topic</span></td>
<td><p>Topic to subscribe to.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">T</span></td>
<td></td>
</tr>
</tbody>
</table>
<a id="Apache_Ignite_Core_Messaging_IMessaging_RemoteListen_" data-uid="Apache.Ignite.Core.Messaging.IMessaging.RemoteListen*"></a>
<h4 id="Apache_Ignite_Core_Messaging_IMessaging_RemoteListen__1_Apache_Ignite_Core_Messaging_IMessageListener___0__System_Object_" data-uid="Apache.Ignite.Core.Messaging.IMessaging.RemoteListen``1(Apache.Ignite.Core.Messaging.IMessageListener{``0},System.Object)">RemoteListen&lt;T&gt;(IMessageListener&lt;T&gt;, Object)</h4>
<div class="markdown level1 summary"><p>Adds a message listener for a given topic to all nodes in the cluster group (possibly including
this node if it belongs to the cluster group as well). This means that any node within this cluster
group can send a message for a given topic and all nodes within the cluster group will receive
listener notifications.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">Guid RemoteListen&lt;T&gt;(IMessageListener&lt;T&gt; listener, object topic = null)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Apache.Ignite.Core.Messaging.IMessageListener-1.html">IMessageListener</a>&lt;T&gt;</td>
<td><span class="parametername">listener</span></td>
<td><p>Predicate that is called on each received message. If predicate returns false,
then it will be unsubscribed from any further notifications.</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Object</span></td>
<td><span class="parametername">topic</span></td>
<td><p>Topic to unsubscribe from.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">Guid</span></td>
<td><p>Operation ID that can be passed to <a class="xref" href="Apache.Ignite.Core.Messaging.IMessaging.html#Apache_Ignite_Core_Messaging_IMessaging_StopRemoteListen_Guid_">StopRemoteListen(Guid)</a> method to stop listening.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">T</span></td>
<td></td>
</tr>
</tbody>
</table>
<a id="Apache_Ignite_Core_Messaging_IMessaging_RemoteListenAsync_" data-uid="Apache.Ignite.Core.Messaging.IMessaging.RemoteListenAsync*"></a>
<h4 id="Apache_Ignite_Core_Messaging_IMessaging_RemoteListenAsync__1_Apache_Ignite_Core_Messaging_IMessageListener___0__System_Object_" data-uid="Apache.Ignite.Core.Messaging.IMessaging.RemoteListenAsync``1(Apache.Ignite.Core.Messaging.IMessageListener{``0},System.Object)">RemoteListenAsync&lt;T&gt;(IMessageListener&lt;T&gt;, Object)</h4>
<div class="markdown level1 summary"><p>Adds a message listener for a given topic to all nodes in the cluster group (possibly including
this node if it belongs to the cluster group as well). This means that any node within this cluster
group can send a message for a given topic and all nodes within the cluster group will receive
listener notifications.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">Task&lt;Guid&gt; RemoteListenAsync&lt;T&gt;(IMessageListener&lt;T&gt; listener, object topic = null)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Apache.Ignite.Core.Messaging.IMessageListener-1.html">IMessageListener</a>&lt;T&gt;</td>
<td><span class="parametername">listener</span></td>
<td><p>Predicate that is called on each received message. If predicate returns false,
then it will be unsubscribed from any further notifications.</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Object</span></td>
<td><span class="parametername">topic</span></td>
<td><p>Topic to unsubscribe from.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">Task</span>&lt;<span class="xref">Guid</span>&gt;</td>
<td><p>Operation ID that can be passed to <a class="xref" href="Apache.Ignite.Core.Messaging.IMessaging.html#Apache_Ignite_Core_Messaging_IMessaging_StopRemoteListen_Guid_">StopRemoteListen(Guid)</a> method to stop listening.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">T</span></td>
<td></td>
</tr>
</tbody>
</table>
<a id="Apache_Ignite_Core_Messaging_IMessaging_Send_" data-uid="Apache.Ignite.Core.Messaging.IMessaging.Send*"></a>
<h4 id="Apache_Ignite_Core_Messaging_IMessaging_Send_System_Object_System_Object_" data-uid="Apache.Ignite.Core.Messaging.IMessaging.Send(System.Object,System.Object)">Send(Object, Object)</h4>
<div class="markdown level1 summary"><p>Sends a message with specified topic to the nodes in the underlying cluster group.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">void Send(object message, object topic = null)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Object</span></td>
<td><span class="parametername">message</span></td>
<td><p>Message to send.</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Object</span></td>
<td><span class="parametername">topic</span></td>
<td><p>Topic to send to, null for default topic.</p>
</td>
</tr>
</tbody>
</table>
<a id="Apache_Ignite_Core_Messaging_IMessaging_SendAll_" data-uid="Apache.Ignite.Core.Messaging.IMessaging.SendAll*"></a>
<h4 id="Apache_Ignite_Core_Messaging_IMessaging_SendAll_IEnumerable_System_Object_" data-uid="Apache.Ignite.Core.Messaging.IMessaging.SendAll(IEnumerable,System.Object)">SendAll(IEnumerable, Object)</h4>
<div class="markdown level1 summary"><p>Sends messages with specified topic to the nodes in the underlying cluster group.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">void SendAll(IEnumerable messages, object topic = null)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">IEnumerable</span></td>
<td><span class="parametername">messages</span></td>
<td><p>Messages to send.</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Object</span></td>
<td><span class="parametername">topic</span></td>
<td><p>Topic to send to, null for default topic.</p>
</td>
</tr>
</tbody>
</table>
<a id="Apache_Ignite_Core_Messaging_IMessaging_SendOrdered_" data-uid="Apache.Ignite.Core.Messaging.IMessaging.SendOrdered*"></a>
<h4 id="Apache_Ignite_Core_Messaging_IMessaging_SendOrdered_System_Object_System_Object_System_Nullable_TimeSpan__" data-uid="Apache.Ignite.Core.Messaging.IMessaging.SendOrdered(System.Object,System.Object,System.Nullable{TimeSpan})">SendOrdered(Object, Object, Nullable&lt;TimeSpan&gt;)</h4>
<div class="markdown level1 summary"><p>Sends a message with specified topic to the nodes in the underlying cluster group.
Messages sent with this method will arrive in the same order they were sent. Note that if a topic is used
for ordered messages, then it cannot be reused for non-ordered messages.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">void SendOrdered(object message, object topic = null, TimeSpan? timeout = null)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Object</span></td>
<td><span class="parametername">message</span></td>
<td><p>Message to send.</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Object</span></td>
<td><span class="parametername">topic</span></td>
<td><p>Topic to send to, null for default topic.</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Nullable</span>&lt;<span class="xref">TimeSpan</span>&gt;</td>
<td><span class="parametername">timeout</span></td>
<td><p>Message timeout, null for for default value from configuration (IgniteConfiguration.getNetworkTimeout).</p>
</td>
</tr>
</tbody>
</table>
<a id="Apache_Ignite_Core_Messaging_IMessaging_StopLocalListen_" data-uid="Apache.Ignite.Core.Messaging.IMessaging.StopLocalListen*"></a>
<h4 id="Apache_Ignite_Core_Messaging_IMessaging_StopLocalListen__1_Apache_Ignite_Core_Messaging_IMessageListener___0__System_Object_" data-uid="Apache.Ignite.Core.Messaging.IMessaging.StopLocalListen``1(Apache.Ignite.Core.Messaging.IMessageListener{``0},System.Object)">StopLocalListen&lt;T&gt;(IMessageListener&lt;T&gt;, Object)</h4>
<div class="markdown level1 summary"><p>Unregisters local listener for given topic on local node only.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">void StopLocalListen&lt;T&gt;(IMessageListener&lt;T&gt; listener, object topic = null)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Apache.Ignite.Core.Messaging.IMessageListener-1.html">IMessageListener</a>&lt;T&gt;</td>
<td><span class="parametername">listener</span></td>
<td><p>Listener predicate.</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Object</span></td>
<td><span class="parametername">topic</span></td>
<td><p>Topic to unsubscribe from.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">T</span></td>
<td></td>
</tr>
</tbody>
</table>
<a id="Apache_Ignite_Core_Messaging_IMessaging_StopRemoteListen_" data-uid="Apache.Ignite.Core.Messaging.IMessaging.StopRemoteListen*"></a>
<h4 id="Apache_Ignite_Core_Messaging_IMessaging_StopRemoteListen_Guid_" data-uid="Apache.Ignite.Core.Messaging.IMessaging.StopRemoteListen(Guid)">StopRemoteListen(Guid)</h4>
<div class="markdown level1 summary"><p>Unregisters all listeners identified with provided operation ID on all nodes in the cluster group.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">void StopRemoteListen(Guid opId)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">Guid</span></td>
<td><span class="parametername">opId</span></td>
<td><p>Operation ID that was returned from <a class="xref" href="Apache.Ignite.Core.Messaging.IMessaging.html#Apache_Ignite_Core_Messaging_IMessaging_RemoteListen__1_Apache_Ignite_Core_Messaging_IMessageListener___0__System_Object_">RemoteListen&lt;T&gt;(IMessageListener&lt;T&gt;, Object)</a> method.</p>
</td>
</tr>
</tbody>
</table>
<a id="Apache_Ignite_Core_Messaging_IMessaging_StopRemoteListenAsync_" data-uid="Apache.Ignite.Core.Messaging.IMessaging.StopRemoteListenAsync*"></a>
<h4 id="Apache_Ignite_Core_Messaging_IMessaging_StopRemoteListenAsync_Guid_" data-uid="Apache.Ignite.Core.Messaging.IMessaging.StopRemoteListenAsync(Guid)">StopRemoteListenAsync(Guid)</h4>
<div class="markdown level1 summary"><p>Unregisters all listeners identified with provided operation ID on all nodes in the cluster group.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">Task StopRemoteListenAsync(Guid opId)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">Guid</span></td>
<td><span class="parametername">opId</span></td>
<td><p>Operation ID that was returned from <a class="xref" href="Apache.Ignite.Core.Messaging.IMessaging.html#Apache_Ignite_Core_Messaging_IMessaging_RemoteListen__1_Apache_Ignite_Core_Messaging_IMessageListener___0__System_Object_">RemoteListen&lt;T&gt;(IMessageListener&lt;T&gt;, Object)</a> method.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">Task</span></td>
<td></td>
</tr>
</tbody>
</table>
</article>
</div>
<div class="hidden-sm col-md-2" role="complementary">
<div class="sideaffix">
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
<h5>In This Article</h5>
<div></div>
</nav>
</div>
</div>
</div>
</div>
<footer>
<div class="grad-bottom"></div>
<div class="footer">
<div class="container">
<span class="pull-right">
<a href="#top">Back to top</a>
</span>
© 2015 - 2019 The Apache Software Foundation
</div>
</div>
</footer>
</div>
<script type="text/javascript" src="../styles/docfx.vendor.js"></script>
<script type="text/javascript" src="../styles/docfx.js"></script>
<script type="text/javascript" src="../styles/main.js"></script>
</body>
</html>