public PublisherRouter(SenderQueue pConsumerQueue, ReaderQueue pReaderQueue, SenderQueue pPublisherQueue) { ConsumerQueue = pConsumerQueue; PublisherQueue = pPublisherQueue; ReaderQueue = pReaderQueue; Executor = new Executor(this); }
/// <summary> /// Creates a router for the IClientConnection /// Will listen on MittoMain queue and send data on the queue with /// as name the same as the connection id /// /// ToDo: see class summary, no need have the listen/send RabbitMQ queues /// here, this can be a single IRouter instead of Queue/IClientConnection /// </summary> /// <param name="pParams"></param> /// <param name="pConnection"></param> public Router(SenderQueue pMainQueue, RequestManager pRequestManager, IClientConnection pConnection) { SenderQueue = pMainQueue; RequestManager = pRequestManager; Connection = pConnection; Connection.Rx += Connection_Rx; }
public ConsumerRouter(SenderQueue pConsumerQueue, RequestManager pRequestManager) { Consumer = pConsumerQueue; RequestManager = pRequestManager; KeepAliveMonitor = new KeepAliveMonitor(60); KeepAliveMonitor.TimeOut += KeepAliveMonitor_TimeOut; KeepAliveMonitor.UnResponsive += KeepAliveMonitor_UnResponsive; KeepAliveMonitor.Start(); }
/// <summary> /// Sends a message to storage queue with properties. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="message">The message body to be sent.</param> /// <param name="properties">The properties of the message.</param> /// <returns>Task.</returns> public async Task Send <T>(T message, KeyValuePair <string, object>[] properties) where T : class { var obj = new MessageEntity <T>(message, properties); var outgoing = new CloudQueueMessage(obj.AsJson()); const long maxAllowedSizeBytes = 64 * 1024; var messageLengthBytes = outgoing.AsBytes.Length; if (messageLengthBytes > maxAllowedSizeBytes) { throw new ArgumentOutOfRangeException(nameof(message), $"Max message size of {maxAllowedSizeBytes} bytes exceeded (message size was {messageLengthBytes})"); } await SenderQueue.AddMessageAsync(outgoing); }
internal RouterCache(SenderQueue pMainQueue, RequestManager pMessageManager) { MainQueue = pMainQueue; RequestManager = pMessageManager; }
public ConsumerRouter(SenderQueue pConsumerQueue) { ConsumerQueue = pConsumerQueue; }
public ConsumerRequest(SenderQueue pProviderQueue, IRouting.RoutingFrame pRequest, Action <IResponseMessage> pCallback) { ProviderQueue = pProviderQueue; Request = pRequest; Action = pCallback; }
public ConsumerRouter(string pConsumerID, SenderQueue pPublisher, RoutingFrame pFrame) { ConnectionID = pConsumerID; Publisher = pPublisher; Request = pFrame; }
public RouterProvider(RabbitMQParams pParams) { SubscriptionExchange = new SenderQueue(QueueType.SubscriptionMain, $"Mitto.Subscription.Main", true); }
//public string SourceID { get { return Router.Request.DestinationID; } } //public string DestinationID { get { return Router.Publisher.QueueName; } } public SubscriptionRouter(ConsumerRouter pRouter, SenderQueue pExchange) { Router = pRouter; Exchange = pExchange; }