예제 #1
0
        public async Task Send <T>(T command, string queueName = "") where T : class
        {
            BusControl = BusControl ?? BuildBus();
            if (queueName == string.Empty)
            {
                queueName = command.GetType().Assembly.GetName().Name + "_CoolBus";
            }

            var sendToUri = new Uri($"rabbitmq://{RabbitConfig.HostName}:{RabbitConfig.Port}/{queueName}");
            var endPoint  = await BusControl.GetSendEndpoint(sendToUri);

            await endPoint.Send(command);
        }
예제 #2
0
 public async Task <ISendEndpoint> GetSendEndpoint(Uri address)
 {
     return(await BusControl.GetSendEndpoint(address).ConfigureAwait(false));
 }