use of org.jgroups.protocols.UNICAST3 in project JGroups by belaban.
the class MessageBeforeConnectedTest method createChannel.
protected static JChannel createChannel(String name) throws Exception {
JChannel ch = new JChannel(new SHARED_LOOPBACK(), new SHARED_LOOPBACK_PING(), new NAKACK2().setBecomeServerQueueSize(10), new UNICAST3(), new GMS().printLocalAddress(false));
ch.setName(name);
return ch;
}
use of org.jgroups.protocols.UNICAST3 in project JGroups by belaban.
the class MergeTest3 method createChannel.
protected static JChannel createChannel(String name) throws Exception {
JChannel retval = new JChannel(new SHARED_LOOPBACK(), new DISCARD().discardAll(true), new SHARED_LOOPBACK_PING(), new NAKACK2().useMcastXmit(false).logDiscardMessages(false).logNotFoundMessages(false), new UNICAST3(), new STABLE().setMaxBytes(50000), new GMS().printLocalAddress(false).setJoinTimeout(1).setLeaveTimeout(100).setMergeTimeout(5000).logViewWarnings(false).setViewAckCollectionTimeout(50).logCollectMessages(false)).name(name);
retval.connect("MergeTest3");
JmxConfigurator.registerChannel(retval, Util.getMBeanServer(), name, retval.getClusterName(), true);
return retval;
}
use of org.jgroups.protocols.UNICAST3 in project JGroups by belaban.
the class ForkChannelTest method testSimpleSend.
public void testSimpleSend() throws Exception {
a.connect(CLUSTER);
fc1 = new ForkChannel(a, "stack", "fc1").connect("bla");
fc2 = new ForkChannel(a, "stack", "fc2").connect("bla");
b = new JChannel(protocols()).name("B").connect(CLUSTER);
fc3 = new ForkChannel(b, "stack", "fc1").connect("bla");
fc4 = new ForkChannel(b, "stack", "fc2").connect("bla");
MyReceiver<Message> r3 = new MyReceiver<Message>().rawMsgs(true), r4 = new MyReceiver<Message>().rawMsgs(true);
fc3.setReceiver(r3);
fc4.setReceiver(r4);
fc1.send(null, "hello");
List<Message> l3 = r3.list(), l4 = r4.list();
Util.waitUntil(10000, 500, () -> !l3.isEmpty() || !l4.isEmpty());
assert !l3.isEmpty();
assert l4.isEmpty();
l3.clear();
Address dest = fc3.getAddress();
fc1.send(dest, "hello2");
for (int i = 0; i < 10; i++) {
if (!l3.isEmpty() || !l4.isEmpty())
break;
Util.sleep(1000);
}
assert !l3.isEmpty();
assert l4.isEmpty();
l3.clear();
// send to non-existing member:
UNICAST3 ucast = a.getProtocolStack().findProtocol(UNICAST3.class);
ucast.setConnCloseTimeout(10000);
Util.close(fc3, fc4, b);
Util.sleep(1000);
System.out.printf("---- sending message to non-existing member %s\n", dest);
fc1.send(dest, "hello3");
for (int i = 0; i < 10; i++) {
if (!l3.isEmpty() || !l4.isEmpty())
break;
Util.sleep(500);
}
assert l3.isEmpty();
assert l4.isEmpty();
}
use of org.jgroups.protocols.UNICAST3 in project JGroups by belaban.
the class FrozenCoordinatorTest method create.
protected JChannel create(String name) throws Exception {
FILE_PING ping = new FILE_PING().setLocation(root_dir.toString()).removeAllDataOnViewChange(true);
Protocol[] protocols = { new SHARED_LOOPBACK(), ping, new NAKACK2(), new UNICAST3(), new STABLE(), new GMS().setJoinTimeout(1000).setMaxJoinAttempts(5) };
return new JChannel(protocols).name(name);
}
Aggregations