use of org.apache.nifi.cluster.coordination.http.replication.RequestCompletionCallback in project nifi by apache.
the class ThreadPoolRequestReplicatorFactoryBean method getObject.
@Override
public ThreadPoolRequestReplicator getObject() throws Exception {
if (replicator == null && nifiProperties.isNode()) {
final EventReporter eventReporter = applicationContext.getBean("eventReporter", EventReporter.class);
final ClusterCoordinator clusterCoordinator = applicationContext.getBean("clusterCoordinator", ClusterCoordinator.class);
final RequestCompletionCallback requestCompletionCallback = applicationContext.getBean("clusterCoordinator", RequestCompletionCallback.class);
final int corePoolSize = nifiProperties.getClusterNodeProtocolCorePoolSize();
final int maxPoolSize = nifiProperties.getClusterNodeProtocolMaxPoolSize();
final int maxConcurrentRequests = nifiProperties.getClusterNodeMaxConcurrentRequests();
final Client jerseyClient = WebUtils.createClient(null, SslContextFactory.createSslContext(nifiProperties));
final String connectionTimeout = nifiProperties.getClusterNodeConnectionTimeout();
final String readTimeout = nifiProperties.getClusterNodeReadTimeout();
replicator = new ThreadPoolRequestReplicator(corePoolSize, maxPoolSize, maxConcurrentRequests, jerseyClient, clusterCoordinator, connectionTimeout, readTimeout, requestCompletionCallback, eventReporter, nifiProperties);
}
return replicator;
}
Aggregations