Exemplo n.º 1
0
 public RabbitProducer(
     IRabbitMQClient rabbitMQClient,
     RabbitEventBus publisher)
 {
     this.publisher      = publisher;
     this.rabbitMQClient = rabbitMQClient;
 }
Exemplo n.º 2
0
 public RabbitProducer(
     IRabbitMQClient rabbitMQClient,
     RabbitEventBus publisher,
     Type grainType)
 {
     GrainType           = grainType;
     this.publisher      = publisher;
     this.rabbitMQClient = rabbitMQClient;
 }
Exemplo n.º 3
0
 public async Task Work(RabbitEventBus bus)
 {
     eventBusDictionary.TryAdd(bus.ProducerType, bus);
     eventBusList.Add(bus);
     using (var channel = await rabbitMQClient.PullModel())
     {
         channel.Model.ExchangeDeclare(bus.Exchange, "direct", true);
     }
 }
Exemplo n.º 4
0
        public async Task Work(RabbitEventBus bus)
        {
            if (eventBusDictionary.TryAdd(bus.ProducerType, bus))
            {
                eventBusList.Add(bus);
                using var channel = await rabbitMQClient.PullModel();

                channel.Model.ExchangeDeclare(bus.Exchange, "direct", true);
            }
            else
            {
                throw new EventBusRepeatException(bus.ProducerType.FullName);
            }
        }