You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each node exposes an HTTP endpoint which accepts messages for registered streams. When a request is received by any instance registered to the cluster, a consistent hashing algorithm is used to determine which node should handle the request. If the node which receives the initial HTTP request is the designated handler it will respond directly, otherwise the receiving node will route the request to the designated node within the cluster.
49
+
Each node exposes an HTTP endpoint which accepts messages for registered
50
+
streams. When a request is received by any instance registered to the cluster,
51
+
a consistent hashing algorithm is used to determine which node should handle
52
+
the request. If the node which receives the initial HTTP request is the
53
+
designated handler it will respond directly, otherwise the receiving node will
54
+
route the request to the designated node within the cluster.
44
55
45
56
*Request:*
46
57
@@ -63,20 +74,21 @@ curl -sX POST http://localhost:8080/api/echo/$RANDOM \
63
74
## Supported protocols
64
75
65
76
Nodes in a cluster will automatically negotiate a protocol to use to
66
-
send/receive messages. The following protocols are registered for each node.
77
+
send/receive messages. The following protocols are registered for each node
@@ -163,9 +175,9 @@ Configure the cluster to join.
163
175
constnode=meshage.init(cluster, 8080);
164
176
```
165
177
166
-
#### *Cluster Implementations:*
178
+
#### Cluster Implementations:
167
179
168
-
#### GrapevineCluster
180
+
#####GrapevineCluster
169
181
170
182
Leverages an implementation of the Gossip protocol to discover nodes and services.
171
183
@@ -180,7 +192,7 @@ new meshage.GrapevineCluster(9473);
180
192
newmeshage.GrapevineCluster(9474, [9473]);
181
193
```
182
194
183
-
#### ConsulCluster
195
+
#####ConsulCluster
184
196
185
197
Connects to a consul agent/cluster for service registration.
186
198
@@ -192,7 +204,7 @@ Connects to a consul agent/cluster for service registration.
192
204
newmeshage.ConsulCluster('127.0.0.1:8500');
193
205
```
194
206
195
-
#### Custom Implementations
207
+
#####Custom cluster implementations
196
208
197
209
Custom cluster types may be provided by implementing the `core/cluster/Cluster` interface.
198
210
@@ -231,7 +243,9 @@ The `router` instance passed to the `start` callback exposes two methods:
231
243
232
244
### Send
233
245
234
-
Sends a message to be handled consistently by a registered handler for the specified stream. Depending on how the message is routed, it could be handled by the node itself.
246
+
Sends a message to be handled consistently by a registered handler for the
247
+
specified stream. Depending on how the message is routed, it could be handled
0 commit comments