public FailedThresholdCallbackNotifier( IOptions <AbpCAPEventBusOptions> options, IExceptionNotifier exceptionNotifier) { Options = options.Value; ExceptionNotifier = exceptionNotifier; }
public AzureServiceBusMessageConsumer( IExceptionNotifier exceptionNotifier, IProcessorPool processorPool) { _exceptionNotifier = exceptionNotifier; _processorPool = processorPool; Logger = NullLogger <AzureServiceBusMessageConsumer> .Instance; _callbacks = new ConcurrentBag <Func <ServiceBusReceivedMessage, Task> >(); }
public KafkaMessageConsumer( IConsumerPool consumerPool, IExceptionNotifier exceptionNotifier, IOptions <AbpKafkaOptions> options) { ConsumerPool = consumerPool; ExceptionNotifier = exceptionNotifier; Options = options.Value; Logger = NullLogger <KafkaMessageConsumer> .Instance; Callbacks = new ConcurrentBag <Func <Message <string, byte[]>, Task> >(); }
public RocketTimer() { ExceptionNotifier = NullExceptionNotifier.Instance; Logger = NullLogger <RocketTimer> .Instance; _taskTimer = new Timer( TimerCallBack, null, Timeout.Infinite, Timeout.Infinite ); }
public ErrorController( IExceptionToErrorInfoConverter exceptionToErrorInfoConverter, IHttpExceptionStatusCodeFinder httpExceptionStatusCodeFinder, IOptions <AbpErrorPageOptions> abpErrorPageOptions, IStringLocalizer <AbpUiResource> localizer, IExceptionNotifier exceptionNotifier) { _errorInfoConverter = exceptionToErrorInfoConverter; _statusCodeFinder = httpExceptionStatusCodeFinder; _localizer = localizer; _exceptionNotifier = exceptionNotifier; _abpErrorPageOptions = abpErrorPageOptions.Value; }
public static Task NotifyAsync( [NotNull] this IExceptionNotifier exceptionNotifier, [NotNull] Exception exception, LogLevel?logLevel = null, bool handled = true) { Check.NotNull(exceptionNotifier, nameof(exceptionNotifier)); return(exceptionNotifier.NotifyAsync( new ExceptionNotificationContext( exception, logLevel, handled ) )); }
/// <summary> /// 初始化一个<see cref="TestController"/>类型的实例 /// </summary> public TestController(ITestService testService , IProcessingServer processingServer , IMessageEventBus messageEventBus , IAdminUnitOfWork unitOfWork , IExceptionNotifier exceptionNotifier , ILogger <TestController> logger , ILog <TestController> otherLog) { TestService = testService; ProcessingServer = processingServer; MessageEventBus = messageEventBus; UnitOfWork = unitOfWork; ExceptionNotifier = exceptionNotifier; Logger = logger; OtherLog = otherLog; }
public RabbitMqMessageConsumer( IConnectionPool connectionPool, RocketTimer timer, IExceptionNotifier exceptionNotifier) { ConnectionPool = connectionPool; Timer = timer; ExceptionNotifier = exceptionNotifier; Logger = NullLogger <RabbitMqMessageConsumer> .Instance; QueueBindCommands = new ConcurrentQueue <QueueBindCommand> (); Callbacks = new ConcurrentBag <Func <IModel, BasicDeliverEventArgs, Task> > (); Timer.Period = 5000; //5 sec. Timer.Elapsed += Timer_Elapsed; Timer.RunOnStart = true; }
public async Task <Result> InsertNewMatchesForSeason(IExceptionNotifier exceptionNotifier, IRootAggregateRepository <FootballTeam> rootAggregateRepositoryFootBallTeam, string seasonIdForFootballMatches, List <FootBallMatch> footBallMatches) { Result vtr = new Result(true); try { bool footballMatchesAreValid = footBallMatches?.Any() ?? false; bool seasonIdIsValid = !String.IsNullOrWhiteSpace(seasonIdForFootballMatches); if (!footballMatchesAreValid || !seasonIdIsValid) { List <string> invalidArguments = new List <string>(); if (!footballMatchesAreValid) { invalidArguments.Add(nameof(footBallMatches)); } if (!seasonIdIsValid) { invalidArguments.Add(nameof(seasonIdForFootballMatches)); } vtr.SetErrorInvalidArguments(invalidArguments.ToArray()); } else { if (SeasonIdForFootballMatches?.Equals(seasonIdForFootballMatches, StringComparison.OrdinalIgnoreCase) ?? false) { vtr.SetError($"Matches with season id {seasonIdForFootballMatches} have already been added"); } else { SeasonIdForFootballMatches = seasonIdForFootballMatches; JSListOfFootBallMatch_Matches = footBallMatches.SerializeToJson(); LastUpdateOfSeasonMatches = DateTime.UtcNow; vtr = await rootAggregateRepositoryFootBallTeam.Update(this); } } } catch (Exception ex) { await exceptionNotifier.Notify(ex, vtr); } return(vtr); }
public KafkaMessageConsumer( IConsumerPool consumerPool, IExceptionNotifier exceptionNotifier, IOptions <AbpKafkaOptions> options, IProducerPool producerPool, AbpAsyncTimer timer) { ConsumerPool = consumerPool; ExceptionNotifier = exceptionNotifier; ProducerPool = producerPool; Timer = timer; Options = options.Value; Logger = NullLogger <KafkaMessageConsumer> .Instance; Callbacks = new ConcurrentBag <Func <Message <string, byte[]>, Task> >(); Timer.Period = 5000; //5 sec. Timer.Elapsed = Timer_Elapsed; Timer.RunOnStart = true; }
public JobQueue( IOptions <AbpBackgroundJobOptions> backgroundJobOptions, IOptions <AbpRabbitMqBackgroundJobOptions> rabbitMqAbpBackgroundJobOptions, IChannelPool channelPool, IRabbitMqSerializer serializer, IBackgroundJobExecuter jobExecuter, IServiceScopeFactory serviceScopeFactory, IExceptionNotifier exceptionNotifier) { AbpBackgroundJobOptions = backgroundJobOptions.Value; AbpRabbitMqBackgroundJobOptions = rabbitMqAbpBackgroundJobOptions.Value; Serializer = serializer; JobExecuter = jobExecuter; ServiceScopeFactory = serviceScopeFactory; ExceptionNotifier = exceptionNotifier; ChannelPool = channelPool; JobConfiguration = AbpBackgroundJobOptions.GetJob(typeof(TArgs)); QueueConfiguration = GetOrCreateJobQueueConfiguration(); Logger = NullLogger <JobQueue <TArgs> > .Instance; }
public async Task <Result> AddFullTimeLiveMatchStats(IExceptionNotifier exceptionNotifier, IRootAggregateRepository <FootballTeam> rootAggregateRepositoryFootballTeam, LiveMatchStats fullTimeLiveMatchStats) { Result vtr = new Result(); try { if (fullTimeLiveMatchStats == null || String.IsNullOrWhiteSpace(fullTimeLiveMatchStats.MatchId)) { vtr.SetErrorInvalidArguments(nameof(fullTimeLiveMatchStats)); } else { if (fullTimeLiveMatchStats.MatchStatus != MatchStatus.FullTime) { vtr.SetError("Match is not over yet"); } else { List <FootBallMatch> matches = JSListOfFootBallMatch_Matches.DeserializeFromJson <List <FootBallMatch> >(); FootBallMatch matchToSet = matches.FirstOrDefault(m => m.MatchId == fullTimeLiveMatchStats.MatchId); if (matchToSet == null) { vtr.SetError($"Match with match id {fullTimeLiveMatchStats.MatchId} was not found"); } else { matchToSet.FullTimeMatchStats = fullTimeLiveMatchStats; JSListOfFootBallMatch_Matches = matches.SerializeToJson(); vtr = await rootAggregateRepositoryFootballTeam.Update(this); } } } } catch (Exception ex) { await exceptionNotifier.Notify(ex, vtr); } return(vtr); }
public AbpEmailingExceptionSubscriber_Test() { _notifier = GetRequiredService <IExceptionNotifier>(); }