Java Code Examples for com.netflix.hystrix.HystrixCommandKey

Following code examples demonstrate how to use com.netflix.hystrix.HystrixCommandKey from netflix-hystrix. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use com.netflix.hystrix.HystrixCommandKey and various code implementation of this class.
Example 1
Project : netflix-hystrix Source File : EventNotifier.java View Source Code on GitHub

	public void markEvent(final HystrixEventType eventType, final HystrixCommandKey key) {
        switch (eventType) {
		case SHORT_CIRCUITED:
			LOGGER.warn("Hystrix circuit breaker open for command {}", key);
			break;
		case THREAD_POOL_REJECTED:
		case SEMAPHORE_REJECTED:
			LOGGER.warn("Hystrix execution rejected for command {}", key);
			break;
		default:
			LOGGER.debug("Hystrix event for command {}: {}", key, eventType);
		}
	}
			
Example 2
Project : netflix-hystrix Source File : EdgeCommand.java View Source Code on GitHub

    protected EdgeCommand(EdgeInvocation invocation, Future<Void> future) {
        super(HystrixCommand.Setter
                .withGroupKey(HystrixCommandGroupKey.Factory.asKey("Provider.vkapp.edge-service.all"))
                .andCommandKey(HystrixCommandKey.Factory.asKey("Provider.vkapp.edge-service.all")));
        this.invocation = invocation;
        this.future = future;
    }
			
Example 3
Project : netflix-hystrix Source File : HystrixEventReceiver.java View Source Code on GitHub

	public void markEvent(HystrixEventType eventType, HystrixCommandKey key) {
		if(eventType==HystrixEventType.THREAD_POOL_REJECTED ) {
			LOGGER.warn("Command: "+key.name()+" failed because of Thread Pool Rejection");			
		} else if(eventType == HystrixEventType.TIMEOUT) {
			LOGGER.warn("Command: "+key.name()+" failed because of Timeout");	
		} else if(eventType == HystrixEventType.SHORT_CIRCUITED) {
			LOGGER.warn("Command: "+key.name()+" was short circuited");	
		}
	}