Ejemplo n.º 1
0
        public SampleTransient(ISampleRequest sampleRequest, ISampleService sampleService, SampleWithoutInterface sampleWithoutInterface)
        {
            this.sampleRequest = sampleRequest;

            this.sampleService = sampleService;

            this.sampleWithoutInterface = sampleWithoutInterface;
        }
Ejemplo n.º 2
0
        public HomeController(ISampleRequest sampleRequest, ISampleService sampleService, SampleWithoutInterface sampleWithoutInterface, SampleTransient sampleTransient)
        {
            this.sampleRequest = sampleRequest;

            this.sampleService = sampleService;

            this.sampleWithoutInterface = sampleWithoutInterface;

            this.sampleTransient = sampleTransient;
        }
Ejemplo n.º 3
0
        public async Task Send(ISampleRequest message)
        {
            try
            {
                _endpoint = await _busControl.GetSendEndpoint(RabbitMqConstants.MessageExchangeUri.Uri);

                await _endpoint.Send <ISampleRequest>(message, x => x.SetRoutingKey(message.RoutingKey));
            }
            catch (Exception e)
            {
                Console.WriteLine("");
                Output.WriteLine(ConsoleColor.Red, "ERROR");
                Output.WriteLine(ConsoleColor.Red, e.Message);
                Output.WriteLine(ConsoleColor.Red, e.InnerException.Message);
            }
        }
Ejemplo n.º 4
0
 public async Task Publish(ISampleRequest message)
 {
     try
     {
         await _busControl.Publish <ISampleRequest>(message, x =>
         {
             x.SetRoutingKey(message.RoutingKey);
             x.DestinationAddress = RabbitMqConstants.MessageExchangeUri.Uri;
         });
     }
     catch (Exception e)
     {
         Console.WriteLine("");
         Output.WriteLine(ConsoleColor.Red, "ERROR");
         Output.WriteLine(ConsoleColor.Red, e.Message);
         Output.WriteLine(ConsoleColor.Red, e.InnerException.Message);
     }
 }