You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by Denis Garus <ga...@gmail.com> on 2020/05/14 15:10:01 UTC
Inconsistent behavior of IgniteMessaging
Hello, Igniters!
IgniteMessaging has inconsistent behavior when a remote listener throws an
exception.
A remote listener throws an exception, if this listener registered on a
node that sends a message,
the sender gets this exception. But if the sender node and the node with
the remote listener aren't the same,
no one will get this exception.
I think the right behavior is to write an exception into a log and ignore
the exception.
WDYT?
The reproducer:
```
public class InconsistentBehaviorOfIgniteMessagingReproducer extends
GridCommonAbstractTest {
@Test
public void test() throws Exception {
startGrids(3);
String topic = "test_topic";
grid(0).message(grid(0).cluster().forNodeId(grid(2).localNode().id()))
.remoteListen(topic, (uuid, msg) -> {
throw new RuntimeException("Ops!");
});
try {
// This line doesn't throw an exception.
grid(1).message().send(topic, "Hello!");
}
catch (Exception e) {
fail("Shouldn't be any exception");
}
// This line throws java.lang.RuntimeException: Ops!
grid(2).message().send(topic, "Hello!");
}
}
```