public QueueSubscription( IChannelProxyFactory proxyFactory, IDispatcher dispatcher, RabbitEndpoint endpoint) { ProxyFactory = proxyFactory; Dispatcher = dispatcher; Endpoint = endpoint; }
public RabbitQueueListener(IChannelProxy proxy, IDispatcher dispatch, RabbitEndpoint endpoint) { Serializer = Assimilate.GetInstanceOf(endpoint.SerializerType) as IMessageSerializer; Loop = new EventLoop(); Loop.Start(8); Running = true; Proxy = proxy; Dispatch = dispatch; RabbitEndpoint = endpoint; proxy.InitConsumer(this); }
public ChannelProxy(IModel channel, string protocol, RabbitEndpoint endpointConfiguration) { _lock = new object(); _channel = channel; _protocol = protocol; _endpoint = endpointConfiguration; if (_endpoint.Transactional) { channel.TxSelect(); } //_onReturn = Assimilate.GetInstanceOf<Action<IModel, BasicReturnEventArgs>>(); //_channel.BasicReturn += new BasicReturnEventHandler( _onReturn ); _channel.ModelShutdown += ChannelShutdown; }
public void CreateSubscription(RabbitEndpoint definition, bool start) { if (Subscriptions.HasSubscription(definition.QueueName)) { return; } var queueSubscription = new QueueSubscription(ProxyFactory, Dispatcher, definition); queueSubscription.Name = definition.QueueName; if (start) { Subscriptions.AddAndStartSubscription(queueSubscription); } else { Subscriptions.AddSubscription(queueSubscription); } }
public IChannelProxy GetProxyForQueue(RabbitEndpoint endpoint) { endpoint.CreateOnBroker(ConnectionManager); return(new ChannelProxy(ConnectionManager.GetConnection(endpoint.Broker).CreateModel(), ConnectionManager.Protocol, endpoint)); }