/// <summary> /// Publishes message /// </summary> public static void Publish <T>(this IMqPublisher publisher, T msg) where T : class { if (publisher == null) { throw new ArgumentNullException(nameof(publisher)); } if (msg == null) { throw new ArgumentNullException(nameof(msg)); } publisher.Publish(new OutgoingMqEnvelop <T> { Message = new MqMessage <T>(msg) }); }
/// <summary> /// Publishes message in queue /// </summary> public static void PublishToQueue <T>(this IMqPublisher publisher, T msg, string queueName) where T : class { if (publisher == null) { throw new ArgumentNullException(nameof(publisher)); } if (msg == null) { throw new ArgumentNullException(nameof(msg)); } publisher.Publish(new OutgoingMqEnvelop <T> { PublishTarget = new PublishTarget { Routing = queueName }, Message = new MqMessage <T>(msg) }); }
public Logic( IRedisService redis, IMqPublisher mqPublisher, IOptions <AsyncProcessorOptions> options, ILogger <Logic> logger = null) { _mqPublisher = mqPublisher; _redis = redis; _options = options.Value; var log = logger?.Dsl(); var callBackQueue = _options?.Callback; if (!string.IsNullOrEmpty(callBackQueue)) { _callbackReporter = new CallbackReporter(_mqPublisher, callBackQueue) { Log = log } } ; }
public OrderController(IMqPublisher busPublisher) { _eventBus = busPublisher; }
public ShippingRequestHandler(IServiceProvider serviceProvider) { _serviceProvider = serviceProvider; mqPublisher = _serviceProvider.GetService(typeof(IMqPublisher)) as IMqPublisher; }
public CallbackReporter(IMqPublisher mqPublisher, string callbackQueue) { _mqPublisher = mqPublisher; _callbackQueue = callbackQueue; }
public TestController(IMqPublisher publisher) { _publisher = publisher; }