public CoreHost(IServiceProvider serviceProvider, ICoreDispatcher dispatcher, IHealthcheck healthcheck, ICoreConnection coreConnection, IApplicationLifetime appLifetime) { _appLifetime = appLifetime ?? throw new CoreException("AppLifetime not defined"); _serviceProvider = serviceProvider ?? throw new CoreException("ServiceProvider not defined"); _coreConnection = coreConnection ?? throw new CoreException("CoreConnection not defined"); _healthcheck = healthcheck ?? throw new CoreException("Healthcheck not defined"); _dispatcher = dispatcher ?? throw new CoreException("CoreDispatcher not defined"); //SIG handlers appLifetime.ApplicationStarted.Register(OnStarted); appLifetime.ApplicationStopping.Register(OnStopping); appLifetime.ApplicationStopped.Register(OnStopped); }
public MessageEntry(ICoreDispatcher dispatcher, ReceivedMessageEventArgs receivedMessage) { ReceivedMessage = receivedMessage; Dispatcher = dispatcher; if (receivedMessage != null) { _via = receivedMessage.GetVia(); IsRequest = receivedMessage.GetHeaderValue(MessageBasicPropertiesHeaders.DIRECTION) != MessageBasicPropertiesHeaders.DIRECTION_VALUE_RESPONSE; if (_via == null) { _via = new ViaContainer() { queue = new Stack <ViaElement>() }; if (receivedMessage.Properties != null) { _via.queue.Push(new ViaElement() { appId = receivedMessage.Properties.AppId, messageId = receivedMessage.Properties.MessageId, mqWorkKind = ExchangeTypes.Get(receivedMessage.GetHeaderValue(MessageBasicPropertiesHeaders.WORKKIND)) ?? ExchangeTypes.EXCHANGETYPE_FANOUT, priority = receivedMessage.Properties.Priority, queryHandlerName = receivedMessage.Properties.ContentType, replyTo = receivedMessage.Properties.ReplyTo }); } } } else { _via = new ViaContainer() { queue = new Stack <ViaElement>() }; } }
public MessageSenderBase(ICoreDispatcher dispatcher) { _dispatcher = dispatcher; }
public QueryHandlerBase(ICoreDispatcher dispatcher) : base(dispatcher) { this._dispatcher = dispatcher; }
public ResponseHandlerBase(ICoreDispatcher dispatcher) : base(dispatcher) { this._dispatcher = dispatcher; }
public MyTestService(ICoreDispatcher dispatcher, IPrepareConfigService config) : base(dispatcher) { this.config = config; }
public MyResponseHanlder(ICoreDispatcher dispatcher) : base(dispatcher) { }
public MyQueryHanlder(ICoreDispatcher dispatcher) : base(dispatcher) { }