HystrixPlugins.getInstance().registerCommandExecutionHook(new MyHystrixCommandExecutionHook());
For now, this class does nothing but override each of the method, write to system.out and then call the default method implementation in the super class.
While it seems straight forward, it doesn't appear that my custom HystrixCommandExecutionHook is getting called. Is there something that I missed?
Thanks,
Joe
import com.netflix.hystrix.HystrixCommand;
import com.netflix.hystrix.HystrixCommandGroupKey;
import com.netflix.hystrix.strategy.HystrixPlugins;
import com.netflix.hystrix.strategy.executionhook.HystrixCommandExecutionHook;
public class Test {
/**
* @param args
*/
public static void main(String[] args) {
HystrixPlugins.getInstance().registerCommandExecutionHook(new HystrixCommandExecutionHook() {
@Override
public <T> void onRunStart(HystrixCommand<T> commandInstance) {
super.onRunStart(commandInstance);
System.out.println("*** Starting ***");
}
});
System.out.println("Execution => " + new HystrixCommand<String>(HystrixCommandGroupKey.Factory.asKey("Testing")) {
@Override
protected String run() throws Exception {
return "Hello World";
}
}.execute());
}
}
*** Starting ***
Execution => Hello World
--
You received this message because you are subscribed to the Google Groups "HystrixOSS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hystrixoss+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.