Example usage for org.springframework.data.gemfire.client PoolFactoryBean setPrSingleHopEnabled

List of usage examples for org.springframework.data.gemfire.client PoolFactoryBean setPrSingleHopEnabled

Introduction

In this page you can find the example usage for org.springframework.data.gemfire.client PoolFactoryBean setPrSingleHopEnabled.

Prototype

public void setPrSingleHopEnabled(boolean prSingleHopEnabled) 

Source Link

Usage

From source file:org.spring.data.gemfire.app.main.SpringGemFireClient.java

@Bean
PoolFactoryBean gemfirePool(@Value("${gemfire.client.server.host:localhost}") String serverHost,
        @Value("${gemfire.client.server.port:40404}") int serverPort,
        @Value("${gemfire.client.server.max-connections:50}") int maxConnections) {
    PoolFactoryBean gemfirePool = new PoolFactoryBean();

    gemfirePool.setFreeConnectionTimeout(intValue(TimeUnit.SECONDS.toMillis(30)));
    gemfirePool.setIdleTimeout(TimeUnit.MINUTES.toMillis(2));
    gemfirePool.setKeepAlive(false);// ww  w.j a  va  2 s.c om
    gemfirePool.setMaxConnections(maxConnections);
    gemfirePool.setPingInterval(TimeUnit.SECONDS.toMillis(15));
    gemfirePool.setReadTimeout(intValue(TimeUnit.SECONDS.toMillis(20)));
    gemfirePool.setRetryAttempts(1);
    gemfirePool.setPrSingleHopEnabled(true);
    gemfirePool.setThreadLocalConnections(false);

    gemfirePool.addServers(new ConnectionEndpoint(serverHost, serverPort));

    return gemfirePool;
}