/** * Makes Primary to this CacheClientProxy and start the dispatcher of the CacheClientProxy * * @param isClientReady Whether the marker has already been processed. This value helps determine * whether to start the dispatcher. */ public void makePrimary(ClientProxyMembershipID proxyId, boolean isClientReady) { CacheClientProxy proxy = getClientProxy(proxyId); if (proxy != null) { proxy.setPrimary(true); /* * If the client represented by this proxy has: - already processed the marker message * (meaning the client is failing over to this server as its primary) <or> - is not durable * (meaning the marker message is being processed automatically * * Then, start or resume the dispatcher. Otherwise, let the clientReady message start the * dispatcher. See CacheClientProxy.startOrResumeMessageDispatcher if * (!proxy._messageDispatcher.isAlive()) { */ if (isClientReady || !proxy.isDurable()) { if (logger.isDebugEnabled()) { logger.debug("CacheClientNotifier: Notifying proxy to start dispatcher for: {}", proxy); } proxy.startOrResumeMessageDispatcher(false); } } else { throw new InternalGemFireError("No cache client proxy on this node for proxyId " + proxyId); } }
/** * Add the input client message to the message queue * * @param clientMessage The <code>Conflatable</code> to add to the queue */ protected void enqueueMessage(Conflatable clientMessage) { try { this._messageQueue.put(clientMessage); if (this._proxy.isPaused() && this._proxy.isDurable()) { this._proxy._cacheClientNotifier.statistics.incEventEnqueuedWhileClientAwayCount(); if (logger.isDebugEnabled()) { logger.debug("{}: Queued message while Durable Client is away {}", this, clientMessage); } } } catch (CancelException e) { throw e; } catch (Exception e) { if (!isStopped()) { this._proxy._statistics.incMessagesFailedQueued(); logger.fatal( String.format("%s: Exception occurred while attempting to add message to queue", this), e); } } }
+ (isDurable() ? " (" + getDurableId() + ")" : ""); this._messageDispatcher = createMessageDispatcher(name);
private void pauseOrUnregisterProxy(Throwable t) { if (getProxy().isDurable()) { try { getProxy().pauseDispatching(); ClientProxyMembershipID proxyID = getProxy().proxyID; chm.removeAllConnectionsAndUnregisterClient(proxyID, t); if (!getProxy().isDurable()) { getProxy().getCacheClientNotifier().unregisterClient(proxyID, false);
private void singletonRouteClientMessage(Conflatable conflatable, Collection<ClientProxyMembershipID> filterClients) { this.cache.getCancelCriterion().checkCancelInProgress(null); // bug #43942 - client notified // but no p2p distribution List<CacheClientProxy> deadProxies = null; for (ClientProxyMembershipID clientId : filterClients) { CacheClientProxy proxy; proxy = this.getClientProxy(clientId, true); if (proxy != null) { if (proxy.isAlive() || proxy.isPaused() || proxy.isConnected() || proxy.isDurable()) { proxy.deliverMessage(conflatable); } else { proxy.getStatistics().incMessagesFailedQueued(); if (deadProxies == null) { deadProxies = new ArrayList<CacheClientProxy>(); } deadProxies.add(proxy); } this.denyListSlowReceiver(proxy); } } if (conflatable instanceof HAEventWrapper) { ((HAEventWrapper) conflatable).decrementPutInProgressCounter(); } // Remove any dead clients from the clients to notify if (deadProxies != null) { closeDeadProxies(deadProxies, false); } }
if (isDurable() && (!stoppedNormally || (getDurableKeepAlive() && stoppedNormally))) { pauseDurable = true;