Example #1
0
        public void Listen(string connectionId)
        {
            Task.Run(() =>
            {
                _successChannel = _channelFactory.CreateChannel();
                _successChannel.SubscribeToExchange(RabbitMqRoutingConfiguration.SuccessExchange, connectionId, ConsumerOnSuccess);
                SuccessSubscriptions.TryAdd(connectionId, _successChannel);
            });

            Task.Run(() =>
            {
                _errorChannel = _channelFactory.CreateChannel();
                _errorChannel.SubscribeToExchange(RabbitMqRoutingConfiguration.ErrorExchange, connectionId, ConsumerOnError);
                ErrorSubscriptions.TryAdd(connectionId, _errorChannel);
            });
        }
 public ShipmentEventsHandler(IDatabase database, ISuccessChannel channel)
 {
     _database = database;
     _channel  = channel;
 }