Search in sources :

Example 1 with WanAcknowledgeType

use of com.hazelcast.config.WanAcknowledgeType 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);
}
Also used : WanBatchPublisherConfig(com.hazelcast.config.WanBatchPublisherConfig) WanReplicationConfig(com.hazelcast.config.WanReplicationConfig) WanAcknowledgeType(com.hazelcast.config.WanAcknowledgeType) WanQueueFullBehavior(com.hazelcast.config.WanQueueFullBehavior)

Aggregations

WanAcknowledgeType (com.hazelcast.config.WanAcknowledgeType)1 WanBatchPublisherConfig (com.hazelcast.config.WanBatchPublisherConfig)1 WanQueueFullBehavior (com.hazelcast.config.WanQueueFullBehavior)1 WanReplicationConfig (com.hazelcast.config.WanReplicationConfig)1