use of com.hazelcast.config.WanReplicationConfig in project hazelcast by hazelcast.
the class AddWanConfigOperation method readInternal.
@Override
protected void readInternal(ObjectDataInput in) throws IOException {
wanReplicationConfig = new WanReplicationConfig();
wanReplicationConfig.readData(in);
}
use of com.hazelcast.config.WanReplicationConfig in project hazelcast by hazelcast.
the class RestTest method addWanConfig.
@Test
public void addWanConfig() throws Exception {
WanReplicationConfig wanConfig = new WanReplicationConfig();
wanConfig.setName("test");
WanReplicationConfigDTO dto = new WanReplicationConfigDTO(wanConfig);
String result = communicator.addWanConfig(dto.toJson().toString());
assertEquals("{\"status\":\"fail\",\"message\":\"java.lang.UnsupportedOperationException: Adding new WAN config is not supported.\"}", result);
}
use of com.hazelcast.config.WanReplicationConfig in project hazelcast by hazelcast.
the class TestFullApplicationContext method testWanReplicationConfig.
@Test
public void testWanReplicationConfig() {
WanReplicationConfig wcfg = config.getWanReplicationConfig("testWan");
assertNotNull(wcfg);
WanPublisherConfig publisherConfig = wcfg.getWanPublisherConfigs().get(0);
assertEquals("tokyo", publisherConfig.getGroupName());
assertEquals("com.hazelcast.enterprise.wan.replication.WanBatchReplication", publisherConfig.getClassName());
assertEquals(WANQueueFullBehavior.THROW_EXCEPTION, publisherConfig.getQueueFullBehavior());
assertEquals(1000, publisherConfig.getQueueCapacity());
Map<String, Comparable> publisherProps = publisherConfig.getProperties();
assertEquals("50", publisherProps.get("batch.size"));
assertEquals("3000", publisherProps.get("batch.max.delay.millis"));
assertEquals("false", publisherProps.get("snapshot.enabled"));
assertEquals("5000", publisherProps.get("response.timeout.millis"));
assertEquals(WanAcknowledgeType.ACK_ON_OPERATION_COMPLETE.name(), publisherProps.get("ack.type"));
assertEquals("pass", publisherProps.get("group.password"));
WanPublisherConfig customPublisher = wcfg.getWanPublisherConfigs().get(1);
assertEquals("istanbul", customPublisher.getGroupName());
assertEquals("com.hazelcast.wan.custom.CustomPublisher", customPublisher.getClassName());
assertEquals(WANQueueFullBehavior.THROW_EXCEPTION_ONLY_IF_REPLICATION_ACTIVE, customPublisher.getQueueFullBehavior());
Map<String, Comparable> customPublisherProps = customPublisher.getProperties();
assertEquals("prop.publisher", customPublisherProps.get("custom.prop.publisher"));
WanConsumerConfig consumerConfig = wcfg.getWanConsumerConfig();
assertEquals("com.hazelcast.wan.custom.WanConsumer", consumerConfig.getClassName());
Map<String, Comparable> consumerProps = consumerConfig.getProperties();
assertEquals("prop.consumer", consumerProps.get("custom.prop.consumer"));
WanReplicationConfig config2 = config.getWanReplicationConfig("testWan2");
WanConsumerConfig consumerConfig2 = config2.getWanConsumerConfig();
consumerConfig2.setProperties(consumerProps);
assertInstanceOf(DummyWanConsumer.class, consumerConfig2.getImplementation());
assertEquals("prop.consumer", consumerConfig2.getProperties().get("custom.prop.consumer"));
}
use of com.hazelcast.config.WanReplicationConfig in project hazelcast by hazelcast.
the class ClientMapWANExceptionTest method getConfig.
@Override
protected Config getConfig() {
Config config = new Config();
WanReplicationConfig wanConfig = new WanReplicationConfig();
wanConfig.setName("dummyWan");
wanConfig.addWanPublisherConfig(getWanPublisherConfig());
WanReplicationRef wanRef = new WanReplicationRef();
wanRef.setName("dummyWan");
wanRef.setMergePolicy(PassThroughMergePolicy.class.getName());
config.addWanReplicationConfig(wanConfig);
config.getMapConfig("default").setWanReplicationRef(wanRef);
return config;
}
Aggregations