use of com.hazelcast.config.WanQueueFullBehavior in project hazelcast by hazelcast.
the class AddWanBatchPublisherConfigMessageTask method call.
@Override
protected Object call() throws Exception {
WanReplicationConfig wanConfig = new WanReplicationConfig();
wanConfig.setName(parameters.name);
WanBatchPublisherConfig publisherConfig = new WanBatchPublisherConfig();
publisherConfig.setPublisherId(parameters.publisherId);
publisherConfig.setClusterName(parameters.targetCluster);
publisherConfig.setTargetEndpoints(parameters.endpoints);
publisherConfig.setQueueCapacity(parameters.queueCapacity);
publisherConfig.setBatchSize(parameters.batchSize);
publisherConfig.setBatchMaxDelayMillis(parameters.batchMaxDelayMillis);
publisherConfig.setResponseTimeoutMillis(parameters.responseTimeoutMillis);
WanAcknowledgeType ackType = WanAcknowledgeType.getById(parameters.ackType);
publisherConfig.setAcknowledgeType(ackType != null ? ackType : DEFAULT_ACKNOWLEDGE_TYPE);
WanQueueFullBehavior queueFullBehavior = WanQueueFullBehavior.getByType(parameters.queueFullBehavior);
publisherConfig.setQueueFullBehavior(queueFullBehavior != null ? queueFullBehavior : DEFAULT_QUEUE_FULL_BEHAVIOUR);
wanConfig.addBatchReplicationPublisherConfig(publisherConfig);
return nodeEngine.getWanReplicationService().addWanReplicationConfig(wanConfig);
}
Aggregations