Пример #1
0
        private async void PublishEvent(AuditorProfileCreationRequest profileRequest)
        {
            //var factory = new ConnectionFactory() { HostName = "localhost" };
            //using (var connection = factory.CreateConnection())
            //using (var channel = connection.CreateModel())
            //{
            //    channel.ExchangeDeclare(exchange: "logs", type: ExchangeType.Fanout);

            //    var message = "Auditor Created";
            //    var body = Encoding.UTF8.GetBytes(message);
            //    channel.BasicPublish(exchange: "logs",
            //                         routingKey: "",
            //                         basicProperties: null,
            //                         body: body);
            //    Console.WriteLine(" [x] Sent {0}", message);
            Uri uri      = new Uri("rabbitmq://localhost/Auditor-Topic");
            var endpoint = await _eventBus.GetSendEndpoint(uri);

            await endpoint.Send <AuditorProfileCreationRequest>(profileRequest);
        }
Пример #2
0
 public void Post([FromBody] AuditorProfileCreationRequest profileRequest)
 {
     string todo = "createprofile";
 }