public MessageReceivingEventArgs( IMessageWrapper messageWrapper) { this.MessageWrapper = messageWrapper ?? throw new ArgumentNullException( nameof(messageWrapper)); }
public void Publish(IMessageWrapper messageWrapper) { var raw = _messageConverter.Serialize(messageWrapper.Message); if (raw == null) { return; } _rabbitMQWrapper.Publish(messageWrapper.Descriptor, raw); }
public void Publish(IMessageWrapper messageWrapper) { var messageBus = _iocResolver.Resolve <IMessageBus>(); messageBus .OnMessageReceivedAsync(messageWrapper.Message, messageWrapper.Descriptor as IRichMessageDescriptor) .GetAwaiter() .GetResult() ; }
public async ValueTask PublishAsync(IMessageWrapper messageWrapper) { var raw = _messageConverter.Serialize(messageWrapper.Message); if (raw == null) { return; } await _rabbitMQWrapper.PublishAsync(messageWrapper.Descriptor, raw); }
public void Get(IMessageWrapper messageWrapper, string storeId, string entryId, string guid) { bool itemHasMoved; string newFolderPath; MailItem mailItem = GetMailItem(storeId, entryId, guid, out itemHasMoved, out newFolderPath); FillMessageWrapperFromMailItem(mailItem, messageWrapper); // We still have an instance of the task item _taskItem.Body = _taskItem.Body.Replace(messageWrapper.LinkLine, Utils.BuildMailItemLink(mailItem, newFolderPath, guid)); //_taskItem.Session.Application. }
private static void FillMessageWrapperFromMailItem(MailItem mailItem, IMessageWrapper messageWrapper) { messageWrapper.Subject = mailItem.Subject; messageWrapper.Sender = mailItem.SenderName; string body = Utils.RemoveHyperLinks(mailItem.Body); messageWrapper.Body = body; if (mailItem.Parent is Folder) { messageWrapper.StoreId = (mailItem.Parent as Folder).StoreID; } messageWrapper.EntryId = mailItem.EntryID; }
private void _taskPaneControl_MailClicked(IMessageWrapper messageWrapper) { try { MailItem mailItem2 = (MailItem)Application.Session.GetItemFromID(messageWrapper.EntryId, messageWrapper.StoreId); if (mailItem2 != null) { mailItem2.Display(); } } catch (COMException) { // Swallow exception } }
private void Log(IMessageWrapper message, string tag) { #if DEBUG System.Diagnostics.Debug #else Console #endif .WriteLine(string.Join("^", LEVEL_INFO, DateTimeOffset.UtcNow.ToString(), tag, message?.Topic ?? NULL, (message?.Timestamp)?.ToString() ?? NULL, message?.Message?.Replace("\r", "")?.Replace("\n", "") ?? NULL )); }
public void Send(IMessageDestination destination, IMessageWrapper message, IMessageDestination responseDestination = null) { Logger.Debug(this, String.Format("{0}: Just sending message to {1} with correlation id {2}", this.ConnectionId, destination.Address, message.CorrelationId)); IBasicProperties basicProperties = _session.Use.CreateBasicProperties(); basicProperties.AppId = this.ConnectionId; basicProperties.CorrelationId = message.CorrelationId; if (responseDestination != null) basicProperties.ReplyTo = responseDestination.Address; _session.Use.BasicPublish(EXCHANGE_NAME, destination.Address, basicProperties, Formatter.Serialize(message.Content.ToString())); Logger.Debug(this, String.Format("{0}: Just sent message to {1} with correlation id {2}", this.ConnectionId, destination.Address, message.CorrelationId)); }
public MessagesController(ICommandBus commandBus, ILogger <MessagesController> logger, IUserContext userContext, IMessageDao messageDao, IMessageWrapper messageWrapper, ISubDao subDao, IModerationDao moderationDao) { _commandBus = commandBus; _logger = logger; _userContext = userContext; _messageDao = messageDao; _messageWrapper = messageWrapper; _subDao = subDao; _moderationDao = moderationDao; }
public MessagesController(ICommandBus commandBus, ILogger<MessagesController> logger, IUserContext userContext, IMessageDao messageDao, IMessageWrapper messageWrapper, ISubDao subDao, IModerationDao moderationDao) { _commandBus = commandBus; _logger = logger; _userContext = userContext; _messageDao = messageDao; _messageWrapper = messageWrapper; _subDao = subDao; _moderationDao = moderationDao; }
public void Send(IMessageDestination topicOrQueue, IMessageWrapper message, Action<IIncomingMessage> responseHandler = null) { _senderChannelPool.UsingObjectFromPool( senderChannel => { if (responseHandler != null) { _receiverChannelPool.ResponseProcessor. AddSpecificResponseHandler(message.CorrelationId, responseHandler); senderChannel.Send(topicOrQueue, message, _receiverChannelPool.UniqueResponseDestination); } else { senderChannel.Send(topicOrQueue, message); } }); }
public async Task SendAsync(IMessageWrapper message) { if (IsConnected) { var retMsg = await _producer.ProduceAsync(message.Topic, //nameof( message.Message ), null, message.Message, blockIfQueueFull : false).ConfigureAwait(false); if (retMsg.Error?.HasError == true) { throw new InvalidOperationException(retMsg.Error.Reason); } return; } if (disposedValue) { throw new ObjectDisposedException( nameof(_producer)); } throw new InvalidOperationException( "The Producer has not been initialized."); }
public virtual void LogReceive(IMessageWrapper message) { Log(message, RECV); }
public async ValueTask PublishAsync(IMessageWrapper messageWrapper) { await Task.Run(() => Publish(messageWrapper)); }
public void Publish(IMessageWrapper messageWrapper) { PublishParameters.Add(messageWrapper); }
public ValueTask PublishAsync(IMessageWrapper messageWrapper) { PublishAsyncParameters.Add(messageWrapper); return(new ValueTask()); }
public ValueTask PublishAsync(IMessageWrapper messageWrapper) { var messageBus = _iocResolver.Resolve <IMessageBus>(); return(messageBus.OnMessageReceivedAsync(messageWrapper.Message, messageWrapper.Descriptor as IRichMessageDescriptor)); }
public ValueTask PublishAsync(IMessageWrapper messageWrapper) { // No Actions. return(new ValueTask()); }
public NotificationProcessor(IGlobalSettings globalSettings, IMessageWrapper messageWrapper) { _globalSettings = globalSettings; _messageWrapper = messageWrapper; _cancellationTokenSource = new CancellationTokenSource(); }
public void Send(IMessageWrapper message) { //No actions. }
public Task<IIncomingMessage> SendAsync(IMessageDestination topicOrQueue, IMessageWrapper message) { throw new NotImplementedException(); }
public void Publish(IMessageWrapper messageWrapper) { // No Actions. }