public setBaseMsgCommand(string name, string birthday, string des, string gender, string deviceID) : base(HystrixCommandSetter.WithGroupKey("KMBAT") .AndCommandKey("setBaseMsg") .AndCommandPropertiesDefaults( new HystrixCommandPropertiesSetter() //使用线程池隔离模式 .WithExecutionIsolationStrategy(ExecutionIsolationStrategy.Thread) //执行超时则打断 .WithExecutionIsolationThreadInterruptOnTimeout(true) //执行超时时间(100毫秒) .WithExecutionIsolationThreadTimeoutInMilliseconds(5000) //当在配置时间窗口内达到此数量的失败后,进行断开。默认20个) .WithCircuitBreakerRequestVolumeThreshold(10) //出错百分比阈值,当达到此阈值后,开始短路。默认50% .WithCircuitBreakerErrorThresholdPercentage(50) //多久以后开始尝试是否恢复,默认5s) .WithCircuitBreakerSleepWindow(TimeSpan.FromSeconds(5)) )) { this.name = name; this.birthday = birthday; this.des = des; this.gender = gender; this.deviceID = deviceID; }
public WriteTrackLogCommand(ITrackLogLogAppender LogAppender, string CollectName, object log) : base(HystrixCommandSetter.WithGroupKey("Log") .AndCommandKey("WriteTrackLog") .AndCommandPropertiesDefaults( new HystrixCommandPropertiesSetter() //使用线程池隔离模式 .WithExecutionIsolationStrategy(ExecutionIsolationStrategy.Thread) //执行超时则打断 .WithExecutionIsolationThreadInterruptOnTimeout(true) //执行超时时间(100毫秒) .WithExecutionIsolationThreadTimeoutInMilliseconds(100) //当在配置时间窗口内达到此数量的失败后,进行断开。默认20个) .WithCircuitBreakerRequestVolumeThreshold(10) //出错百分比阈值,当达到此阈值后,开始短路。默认50% .WithCircuitBreakerErrorThresholdPercentage(50) //多久以后开始尝试是否恢复,默认5s) .WithCircuitBreakerSleepWindow(TimeSpan.FromSeconds(10)) )) { this.LogAppender = LogAppender; this.CollectName = CollectName; this.log = log; }
public TestCommand(string value, bool fail, bool failOnFallback) : base(HystrixCommandSetter .WithGroupKey("RequestLogTestCommand")) { this.value = value; this.fail = fail; this.failOnFallback = failOnFallback; }
public GetCurrentTimeCommand() : base(HystrixCommandSetter.WithGroupKey("TimeGroup") .AndCommandKey("GetCurrentTime") .AndCommandPropertiesDefaults( new HystrixCommandPropertiesSetter() .WithExecutionIsolationThreadTimeout(TimeSpan.FromSeconds(1.0)) .WithExecutionIsolationStrategy(ExecutionIsolationStrategy.Semaphore) .WithExecutionIsolationThreadInterruptOnTimeout(true))) { }
public HystrixCommandSetter BuildCommandSettings(Type type) { var key = type.Name; return(HystrixCommandSetter.WithGroupKey(key) .AndCommandKey(key) .AndCommandPropertiesDefaults( new HystrixCommandPropertiesSetter() .WithExecutionIsolationThreadTimeout(TimeSpan.FromSeconds(1.0)) .WithExecutionIsolationStrategy(ExecutionIsolationStrategy.Semaphore) .WithExecutionIsolationThreadInterruptOnTimeout(true))); }
public pullCommand(string sessionID) : base(HystrixCommandSetter.WithGroupKey("KMBAT") .AndCommandKey("pull") .AndCommandPropertiesDefaults( new HystrixCommandPropertiesSetter() //使用线程池隔离模式 .WithExecutionIsolationStrategy(ExecutionIsolationStrategy.Thread) //执行超时则打断 .WithExecutionIsolationThreadInterruptOnTimeout(true) //执行超时时间(100毫秒) .WithExecutionIsolationThreadTimeoutInMilliseconds(5000) //当在配置时间窗口内达到此数量的失败后,进行断开。默认20个) .WithCircuitBreakerRequestVolumeThreshold(10) //出错百分比阈值,当达到此阈值后,开始短路。默认50% .WithCircuitBreakerErrorThresholdPercentage(50) //多久以后开始尝试是否恢复,默认5s) .WithCircuitBreakerSleepWindow(TimeSpan.FromSeconds(5)) )) { this.sessionID = sessionID; }
public WriteDebugLogCommand(string info, Exception ex) : base(HystrixCommandSetter.WithGroupKey("Log") .AndCommandKey("WriteDebugLog") .AndCommandPropertiesDefaults( new HystrixCommandPropertiesSetter() //使用线程池隔离模式 .WithExecutionIsolationStrategy(ExecutionIsolationStrategy.Thread) //执行超时则打断 .WithExecutionIsolationThreadInterruptOnTimeout(true) //执行超时时间(100毫秒) .WithExecutionIsolationThreadTimeoutInMilliseconds(100) //当在配置时间窗口内达到此数量的失败后,进行断开。默认20个) .WithCircuitBreakerRequestVolumeThreshold(10) //出错百分比阈值,当达到此阈值后,开始短路。默认50% .WithCircuitBreakerErrorThresholdPercentage(50) //多久以后开始尝试是否恢复,默认5s) .WithCircuitBreakerSleepWindow(TimeSpan.FromSeconds(10)) )) { this.info = info; this.ex = ex; }
public msgPushCommand(string OrderID, string FromAccountId, string ToAlias, string Content) : base(HystrixCommandSetter.WithGroupKey("KMBAT") .AndCommandKey("msgPush") .AndCommandPropertiesDefaults( new HystrixCommandPropertiesSetter() //使用线程池隔离模式 .WithExecutionIsolationStrategy(ExecutionIsolationStrategy.Thread) //执行超时则打断 .WithExecutionIsolationThreadInterruptOnTimeout(true) //执行超时时间(100毫秒) .WithExecutionIsolationThreadTimeoutInMilliseconds(5000) //当在配置时间窗口内达到此数量的失败后,进行断开。默认20个) .WithCircuitBreakerRequestVolumeThreshold(10) //出错百分比阈值,当达到此阈值后,开始短路。默认50% .WithCircuitBreakerErrorThresholdPercentage(50) //多久以后开始尝试是否恢复,默认5s) .WithCircuitBreakerSleepWindow(TimeSpan.FromSeconds(5)) )) { this.Content = Content; this.FromAccountId = FromAccountId; this.ToAlias = ToAlias; this.OrderID = OrderID; }
public HandleMessageHystrixCommand(Middleware <HandleContext> actualHandle, Execution <HandleContext> context, HystrixCommandSetter hystrixCfg) : base(hystrixCfg) { this.actualHandle = actualHandle; this.context = context; }