String.valueOf(cp.getSubscriptionAckInterval())); if (generateDefaults() || cp.getSubscriptionEnabled() != PoolFactory.DEFAULT_SUBSCRIPTION_ENABLED) atts.addAttribute("", "", SUBSCRIPTION_ENABLED, "", String.valueOf(cp.getSubscriptionEnabled())); if (generateDefaults() || cp .getSubscriptionMessageTrackingTimeout() != PoolFactory.DEFAULT_SUBSCRIPTION_MESSAGE_TRACKING_TIMEOUT)
ServerRegionProxy proxy = ((InternalRegion) newRegion).getServerProxy(); if (proxy != null) { if (((Pool) proxy.getPool()).getSubscriptionEnabled()) { try { newRegion.registerInterest("ALL_KEYS");
/** * Initializes the state of this factory for the given pool's state. */ public void init(Pool cp) { setSocketConnectTimeout(cp.getSocketConnectTimeout()); setFreeConnectionTimeout(cp.getFreeConnectionTimeout()); setLoadConditioningInterval(cp.getLoadConditioningInterval()); setSocketBufferSize(cp.getSocketBufferSize()); setReadTimeout(cp.getReadTimeout()); setMinConnections(cp.getMinConnections()); setMaxConnections(cp.getMaxConnections()); setRetryAttempts(cp.getRetryAttempts()); setIdleTimeout(cp.getIdleTimeout()); setPingInterval(cp.getPingInterval()); setStatisticInterval(cp.getStatisticInterval()); setThreadLocalConnections(cp.getThreadLocalConnections()); setSubscriptionEnabled(cp.getSubscriptionEnabled()); setPRSingleHopEnabled(cp.getPRSingleHopEnabled()); setSubscriptionRedundancy(cp.getSubscriptionRedundancy()); setSubscriptionMessageTrackingTimeout(cp.getSubscriptionMessageTrackingTimeout()); setSubscriptionAckInterval(cp.getSubscriptionAckInterval()); setServerGroup(cp.getServerGroup()); setMultiuserAuthentication(cp.getMultiuserAuthentication()); for (InetSocketAddress inetSocketAddress : cp.getLocators()) { addLocator(inetSocketAddress.getHostName(), inetSocketAddress.getPort()); } this.attributes.servers.addAll(cp.getServers()); }
this.pingInterval = attributes.getPingInterval(); this.statisticInterval = attributes.getStatisticInterval(); this.subscriptionEnabled = attributes.getSubscriptionEnabled(); this.prSingleHopEnabled = attributes.getPRSingleHopEnabled(); this.subscriptionRedundancyLevel = attributes.getSubscriptionRedundancy();
/** * Return true if the given Pool is compatible with these attributes. Currently this does what * equals would but in the future we might decide to weaken the compatibility contract. * * @since GemFire 6.5 */ public boolean isCompatible(Pool p) { if (p == null) return false; return getFreeConnectionTimeout() == p.getFreeConnectionTimeout() && getSocketConnectTimeout() == p.getSocketConnectTimeout() && getLoadConditioningInterval() == p.getLoadConditioningInterval() && getSocketBufferSize() == p.getSocketBufferSize() && getMinConnections() == p.getMinConnections() && getMaxConnections() == p.getMaxConnections() && getIdleTimeout() == p.getIdleTimeout() && getPingInterval() == p.getPingInterval() && getStatisticInterval() == p.getStatisticInterval() && getRetryAttempts() == p.getRetryAttempts() && getThreadLocalConnections() == p.getThreadLocalConnections() && getReadTimeout() == p.getReadTimeout() && getSubscriptionEnabled() == p.getSubscriptionEnabled() && getPRSingleHopEnabled() == p.getPRSingleHopEnabled() && getSubscriptionRedundancy() == p.getSubscriptionRedundancy() && getSubscriptionMessageTrackingTimeout() == p.getSubscriptionMessageTrackingTimeout() && getSubscriptionAckInterval() == p.getSubscriptionAckInterval() && getServerGroup().equals(p.getServerGroup()) && getMultiuserAuthentication() == p.getMultiuserAuthentication() && getLocators().equals(p.getLocators()) && getServers().equals(p.getServers()); }
.setPoolThreadLocalConnections(poolAttr.getThreadLocalConnections()) .setPoolReadTimeout(poolAttr.getReadTimeout()) .setPoolSubscriptionEnabled(poolAttr.getSubscriptionEnabled()) .setPoolPRSingleHopEnabled(poolAttr.getPRSingleHopEnabled()) .setPoolSubscriptionRedundancy(poolAttr.getSubscriptionRedundancy())
+ cpName); } else { if (!cp.getSubscriptionEnabled()) { throw new IllegalStateException( "The client pool of a DynamicRegionFactory must be configured with queue-enabled set to true.");
public boolean getSubscriptionEnabled(Boolean defaultSubscriptionEnabled) { return defaultIfNull(defaultSubscriptionEnabled, () -> getDelegate().getSubscriptionEnabled()); }
public boolean getSubscriptionEnabled(Boolean defaultSubscriptionEnabled) { return defaultIfNull(defaultSubscriptionEnabled, () -> getDelegate().getSubscriptionEnabled()); }
@SuppressWarnings("all") private void verifyClientCacheSubscriptionQueueConnectionsEstablished() { resolvePools().stream() .filter(pool -> pool.getSubscriptionEnabled()) .filter(pool -> pool instanceof PoolImpl) .map(pool -> (PoolImpl) pool) .forEach(pool -> { long timeout = System.currentTimeMillis() + resolveTimeout(); while (System.currentTimeMillis() < timeout && !pool.isPrimaryUpdaterAlive()) { synchronized (pool) { ObjectUtils.doOperationSafely(() -> { TimeUnit.MILLISECONDS.timedWait(pool, 500L); return null; }); } } String errorMessage = String.format("ClientCache subscription queue connection not established;" + " Pool [%s] has configuration [locators = %s, servers = %s]", pool, pool.getLocators(), pool.getServers()); if (isThrowExceptionOnSubscriptionQueueConnectionFailure()) { Assert.state(pool.isPrimaryUpdaterAlive(), errorMessage); } else if (getLogger().isWarnEnabled()){ getLogger().warn(errorMessage); } }); }
when(mockPool.getStatisticInterval()).thenReturn(statisticInterval.get()); when(mockPool.getSubscriptionAckInterval()).thenReturn(subscriptionAckInterval.get()); when(mockPool.getSubscriptionEnabled()).thenReturn(subscriptionEnabled.get()); when(mockPool.getSubscriptionMessageTrackingTimeout()).thenReturn(subscriptionMessageTrackingTimeout.get()); when(mockPool.getSubscriptionRedundancy()).thenReturn(subscriptionRedundancy.get());
.withDetail(poolKey(poolName, "statistic-interval"), pool.getStatisticInterval()) .withDetail(poolKey(poolName, "subscription-ack-interval"), pool.getSubscriptionAckInterval()) .withDetail(poolKey(poolName, "subscription-enabled"), toYesNoString(pool.getSubscriptionEnabled())) .withDetail(poolKey(poolName, "subscription-message-tracking-timeout"), pool.getSubscriptionMessageTrackingTimeout()) .withDetail(poolKey(poolName, "subscription-redundancy"), pool.getSubscriptionRedundancy())