Beispiel #1
0
 public QueueSubscription(
     IChannelProxyFactory proxyFactory,
     IDispatcher dispatcher,
     RabbitEndpoint endpoint )
 {
     ProxyFactory = proxyFactory;
     Dispatcher = dispatcher;
     Endpoint = endpoint;
 }
        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 );
        }
Beispiel #3
0
        public RabbitEndpoint GetEndpointByQueue(string queueName)
        {
            RabbitEndpoint endpoint = null;

            _endpointsByQueue.TryGetValue(queueName, out endpoint);
            if (endpoint == null)
            {
                throw new ConfigurationException(
                          "There was no endpoint configured for queue {0}. Please provide configuration using the AddEndPoint method on the IBus interface."
                          .AsFormat(queueName));
            }
            return(endpoint);
        }
 public EndpointConfigurator()
 {
     RabbitEndpoint = new RabbitEndpoint();
 }
Beispiel #5
0
 public void AddEndpoint( RabbitEndpoint endpoint )
 {
     _endpointsByQueue[endpoint.QueueName] = endpoint;
 }
 public IChannelProxy GetProxyForQueue( RabbitEndpoint endpoint )
 {
     endpoint.CreateOnBroker( ConnectionManager );
     return new ChannelProxy( ConnectionManager.GetConnection( endpoint.Broker ).CreateModel(),
                              ConnectionManager.Protocol, endpoint );
 }
Beispiel #7
0
 public void AddEndpoint(RabbitEndpoint endpoint)
 {
     endpoint.CreateOnBroker(ConnectionManager);
     EndpointIndex.AddEndpoint(endpoint);
 }
Beispiel #8
0
 public void AddEndpoint( RabbitEndpoint endpoint )
 {
     endpoint.CreateOnBroker( ConnectionManager );
     EndpointIndex.AddEndpoint( endpoint );
 }
Beispiel #9
0
 public void AddEndpoint(RabbitEndpoint endpoint)
 {
     _endpointsByQueue[endpoint.QueueName] = endpoint;
 }
Beispiel #10
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 );
 }