Пример #1
0
        public PersistentConnection(ConnectionFactoryWrapper connectionFactory)
        {
            Preconditions.CheckNotNull(connectionFactory, "connectionFactory");

            this._connectionFactory = connectionFactory;
            TryToConnect(null);
        }
        public ConsumerErrorStrategy(
            ConnectionFactoryWrapper connectionFactory)
        {
            Preconditions.CheckNotNull(connectionFactory, "connectionFactory");

            this._connectionFactory = connectionFactory;
        }
Пример #3
0
        public RabbitAdvancedBus(
            ConnectionFactoryWrapper connectionFactory,
            ConsumerFactory consumerFactory,
            IPublisher publisher,
            ConnectionConfiguration connectionConfiguration)
        {
            Preconditions.CheckNotNull(connectionFactory, "connectionFactory");
            Preconditions.CheckNotNull(consumerFactory, "consumerFactory");
            Preconditions.CheckNotNull(publisher, "publisher");
            Preconditions.CheckNotNull(connectionConfiguration, "connectionConfiguration");

            this._consumerFactory         = consumerFactory;
            this._publisher               = publisher;
            this._connectionConfiguration = connectionConfiguration;

            this._connection = new PersistentConnection(connectionFactory);

            EventBus.Instance.Subscribe <ConnectionCreatedEvent>(e => this.OnConnected());
            EventBus.Instance.Subscribe <ConnectionDisconnectedEvent>(e => this.OnDisconnected());
            EventBus.Instance.Subscribe <ReturnedMessageEvent>(this.OnMessageReturned);
            EventBus.Instance.Subscribe <ConfirmedMessageEvent>(this.OnMessageConfirmed);
            EventBus.Instance.Subscribe <ConfirmedMessageTimeOutEvent>(this.OnMessageConfirmedTimeout);

            PersistentChannelFactory persistentChannelFactory = new PersistentChannelFactory(connectionConfiguration);

            this._clientCommandDispatcher = new ClientCommandDispatcherSingleton(this._connection, persistentChannelFactory);
        }