Ejemplo n.º 1
0
        public static Uri GetSchedulerAddress(RabbitMqBusConfiguration rabbitMqBusConfiguration, string queueName)
        {
            if (string.IsNullOrWhiteSpace(queueName))
            {
                throw new ArgumentNullException(nameof(queueName));
            }
            if (rabbitMqBusConfiguration == null)
            {
                throw new ArgumentNullException(nameof(rabbitMqBusConfiguration));
            }
            if (rabbitMqBusConfiguration.VirtualHost == "/")
            {
                return(new Uri($"{rabbitMqBusConfiguration.Protocol}://{rabbitMqBusConfiguration.Host}:{rabbitMqBusConfiguration.Port}/{queueName}"));
            }

            return(new Uri($"{rabbitMqBusConfiguration.Protocol}://{rabbitMqBusConfiguration.Host}:{rabbitMqBusConfiguration.Port}/{rabbitMqBusConfiguration.VirtualHost}/{queueName}"));
        }
Ejemplo n.º 2
0
 public static string GetAmqpFormat(RabbitMqBusConfiguration rabbitMqBusConfiguration)
 {
     return(rabbitMqBusConfiguration.Endpoint.Replace("rabbitmq://", "amqp://"));
 }