コード例 #1
0
 public QueueSubscription(
     IChannelProxyFactory proxyFactory,
     IDispatcher dispatcher,
     RabbitEndpoint endpoint)
 {
     ProxyFactory = proxyFactory;
     Dispatcher   = dispatcher;
     Endpoint     = endpoint;
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 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;
 }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
 public IChannelProxy GetProxyForQueue(RabbitEndpoint endpoint)
 {
     endpoint.CreateOnBroker(ConnectionManager);
     return(new ChannelProxy(ConnectionManager.GetConnection(endpoint.Broker).CreateModel(),
                             ConnectionManager.Protocol, endpoint));
 }