I am getting an exception when publishing a scheduled message.
MassTransit.EndpointNotFoundException: The endpoint address specified an unknown host: rabbitmq://localhost:5672/local
at MassTransit.RabbitMqTransport.Transport.RabbitMqSendTransportProvider.GetSendTransport(Uri address)
at MassTransit.RabbitMqTransport.Transport.RabbitMqSendEndpointProvider.<GetSendEndpoint>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MassTransit.Transports.SendEndpointCache.<GetSendEndpointFromProvider>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MassTransit.Util.Caching.PendingValue`2.<CreateValue>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MassTransit.Transports.SendEndpointCache.<GetSendEndpoint>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MassTransit.Util.TaskUtil.Await[T](Func`1 taskFactory, CancellationToken cancellationToken)
at MassTransit.QuartzIntegration.ScheduledMessageJob.Execute(IJobExecutionContext context)
I have looked at the code and it looks like MT can't find the host when matching the settings in MassTransit.RabbitMqTransport.Topology.RabbitMqHostEqualityComparer
I have taken a copy of the code and logged out the comparison, it looks like the virtualhost, username and password have been removed at some point.
Here is my code to configure the quartz endpoint.
public static void UseSelfHostedQuartzScheduler(this IRabbitMqBusFactoryConfigurator configurator, IScheduler scheduler, IRabbitMqHost host, string queueName)
{
configurator.ReceiveEndpoint(host, queueName, r =>
{
var partitioner = configurator.CreatePartitioner(16);
r.Consumer(() => new ScheduleMessageConsumer(scheduler), x => x.Message<ScheduleMessage>(m => m.UsePartitioner(partitioner, p => p.Message.CorrelationId)));
r.Consumer(() => new CancelScheduledMessageConsumer(scheduler), x => x.Message<CancelScheduledMessage>(m => m.UsePartitioner(partitioner, p => p.Message.TokenId)));
configurator.UseMessageScheduler(r.InputAddress);
var specification = new SchedulerBusFactorySpecification(scheduler, r.InputAddress);
configurator.AddBusFactorySpecification(specification);
});
}