/** * Sets the redundancy level for this pools server-to-client subscriptions. If <code>0</code> then * no redundant copies will be kept on the servers. Otherwise an effort will be made to maintain * the requested number of copies of the server-to-client subscriptions. At most one copy per * server will be made up to the requested level. * * @param redundancy the number of redundant servers for this client's subscriptions. * @return a reference to <code>this</code> * @throws IllegalArgumentException if <code>redundancyLevel</code> is less than <code>-1</code>. */ public ClientCacheFactory setPoolSubscriptionRedundancy(int redundancy) { getPoolFactory().setSubscriptionRedundancy(redundancy); return this; }
protected void startBridgeClient(final String group, final String host, final int port, final String[] regions) throws Exception { PoolFactoryImpl pf = new PoolFactoryImpl(null); pf.addLocator(host, port).setServerGroup(group).setPingInterval(200) .setSubscriptionEnabled(true).setSubscriptionRedundancy(-1); startBridgeClient(pf.getPoolAttributes(), regions); }
protected void startBridgeClientInVM(VM vm, final String group, final String host, final int port, final String... regions) throws Exception { PoolFactoryImpl pf = new PoolFactoryImpl(null); pf.addLocator(host, port).setServerGroup(group).setPingInterval(200) .setSubscriptionEnabled(true).setSubscriptionRedundancy(-1); startBridgeClientInVM(vm, pf.getPoolAttributes(), regions); }
f.setSubscriptionRedundancy(parseInt(v));
addServers(poolFactory, h, ports).setSubscriptionEnabled(true).setThreadLocalConnections(true) .setReadTimeout(5000).setSocketBufferSize(32768).setMinConnections(3) .setSubscriptionRedundancy(1).setPingInterval(2000);
void createClientCacheAndVerifyPingIntervalIsSet(String host, int port) throws Exception { PoolImpl pool = null; try { Properties props = new Properties(); props.setProperty(MCAST_PORT, "0"); props.setProperty(LOCATORS, ""); createCache(props); pool = (PoolImpl) PoolManager.createFactory().addServer(host, port) .setSubscriptionEnabled(true).setThreadLocalConnections(false).setReadTimeout(1000) .setSocketBufferSize(32768).setMinConnections(1).setSubscriptionRedundancy(-1) .setPingInterval(2000).create("test pool"); Region<Object, Object> region = cache.createRegionFactory(RegionShortcut.LOCAL) .setPoolName("test pool").create(REGION_NAME1); region.registerInterest(".*"); /** get the subscription connection and verify that it has the correct timeout setting */ QueueConnectionImpl primaryConnection = (QueueConnectionImpl) pool.getPrimaryConnection(); int pingInterval = ((CacheClientUpdater) primaryConnection.getUpdater()) .getServerQueueStatus().getPingInterval(); assertNotEquals(0, pingInterval); assertEquals(CacheClientNotifier.getClientPingInterval(), pingInterval); } finally { cache.close(); } }
String host = NetworkUtils.getServerHostName(); Pool p = PoolManager.createFactory().addServer(host, PORT1).setSubscriptionEnabled(true) .setSubscriptionRedundancy(-1)
String host = NetworkUtils.getServerHostName(); Pool p = PoolManager.createFactory().addServer(host, PORT1).setSubscriptionEnabled(true) .setSubscriptionRedundancy(-1)
(PoolImpl) PoolManager.createFactory().addServer(host, PORT1).setSubscriptionEnabled(true) .setThreadLocalConnections(true).setReadTimeout(1000).setSocketBufferSize(32768) .setMinConnections(3).setSubscriptionRedundancy(-1).setPingInterval(2000)
pf.setSubscriptionRedundancy(redundancy); pf.setSubscriptionAckInterval(1);
.thenAnswer(newSetter(subscriptionMessageTrackingTimeout, mockPoolFactory)); when(mockPoolFactory.setSubscriptionRedundancy(anyInt())) .thenAnswer(newSetter(subscriptionRedundancy, mockPoolFactory));
mockPoolFactory.setSubscriptionRedundancy(invocation.getArgument(0)); return clientCacheFactorySpy; }).when(clientCacheFactorySpy).setPoolSubscriptionRedundancy(anyInt());
it.setSubscriptionEnabled(this.subscriptionEnabled); it.setSubscriptionMessageTrackingTimeout(this.subscriptionMessageTrackingTimeout); it.setSubscriptionRedundancy(this.subscriptionRedundancy); it.setSubscriptionTimeoutMultiplier(this.subscriptionTimeoutMultiplier); it.setThreadLocalConnections(this.threadLocalConnections);
it.setSubscriptionEnabled(this.subscriptionEnabled); it.setSubscriptionMessageTrackingTimeout(this.subscriptionMessageTrackingTimeout); it.setSubscriptionRedundancy(this.subscriptionRedundancy); it.setSubscriptionTimeoutMultiplier(this.subscriptionTimeoutMultiplier); it.setThreadLocalConnections(this.threadLocalConnections);