concurrentAccessReplicator.replicate(throttleKey, true);
concurrentAccessReplicator = new ConcurrentAccessReplicator(configContext);
/** * Decrement the internal counter for concurrency throttling, in case of normal response retrieval, * delayed response at synapse timeout, exceptional cases while mediation end up trigger fault. * In clustered environment, replicate the decremented value to other members. * * @param synCtx Synapse Message Context of which mediation occurs. */ public static void decrementConcurrencyThrottleAccessController(MessageContext synCtx) { Boolean isConcurrencyThrottleEnabled = (Boolean) synCtx .getProperty(SynapseConstants.SYNAPSE_CONCURRENCY_THROTTLE); if (isConcurrencyThrottleEnabled != null && isConcurrencyThrottleEnabled) { ConcurrentAccessController concurrentAccessController = (ConcurrentAccessController) synCtx .getProperty(SynapseConstants.SYNAPSE_CONCURRENT_ACCESS_CONTROLLER); int available = concurrentAccessController.incrementAndGet(); int concurrentLimit = concurrentAccessController.getLimit(); if (log.isDebugEnabled()) { log.debug("Concurrency Throttle : Connection returned" + " :: " + available + " of available of" + concurrentLimit + " connections"); } ConcurrentAccessReplicator concurrentAccessReplicator = (ConcurrentAccessReplicator) synCtx .getProperty(SynapseConstants.SYNAPSE_CONCURRENT_ACCESS_REPLICATOR); String throttleKey = (String) synCtx.getProperty(SynapseConstants.SYNAPSE_CONCURRENCY_THROTTLE_KEY); if (concurrentAccessReplicator != null) { concurrentAccessReplicator.replicate(throttleKey, true); } //once decremented, clear the flag since we no longer required to decrement the value //concurrency throttle access controller synCtx.setProperty(SynapseConstants.SYNAPSE_CONCURRENCY_THROTTLE, false); } }
protected void informFailure(MessageContext synCtx, int errorCode, String errorMsg) { Boolean isConcurrencyThrottleEnabled = (Boolean) synCtx .getProperty(SynapseConstants.SYNAPSE_CONCURRENCY_THROTTLE); if (isConcurrencyThrottleEnabled != null && isConcurrencyThrottleEnabled) { ConcurrentAccessController concurrentAccessController = (ConcurrentAccessController) synCtx .getProperty(SynapseConstants.SYNAPSE_CONCURRENT_ACCESS_CONTROLLER); int available = concurrentAccessController.incrementAndGet(); int concurrentLimit = concurrentAccessController.getLimit(); if (log.isDebugEnabled()) { log.debug("Concurrency Throttle : Connection returned" + " :: " + available + " of available of " + concurrentLimit + " connections"); } ConcurrentAccessReplicator concurrentAccessReplicator = (ConcurrentAccessReplicator) synCtx .getProperty(SynapseConstants.SYNAPSE_CONCURRENT_ACCESS_REPLICATOR); String throttleKey = (String) synCtx .getProperty(SynapseConstants.SYNAPSE_CONCURRENCY_THROTTLE_KEY); if (concurrentAccessReplicator != null) { concurrentAccessReplicator.replicate(throttleKey, true); } } if (synCtx.getProperty(SynapseConstants.LAST_ENDPOINT) == null) { setErrorOnMessage(synCtx, errorCode, errorMsg); } invokeNextFaultHandler(synCtx); }
.getProperty(SynapseConstants.SYNAPSE_CONCURRENCY_THROTTLE_KEY); if (concurrentAccessReplicator != null) { concurrentAccessReplicator.replicate(throttleKey, true);
.getProperty(SynapseConstants.SYNAPSE_CONCURRENCY_THROTTLE_KEY); if (concurrentAccessReplicator != null) { concurrentAccessReplicator.replicate(throttleKey, true);
"states of the ConcurrentAccessController with key : " + key); concurrentAccessReplicator.replicate(key, false);