UseMessageScheduler with virutalhost, username and password

104 views
Skip to first unread message

Wil Jones

unread,
May 15, 2017, 11:28:08 AM5/15/17
to masstransit-discuss
Hello,

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);
            });
        }

Chris Patterson

unread,
May 15, 2017, 1:19:13 PM5/15/17
to masstrans...@googlegroups.com
Is your bus configuration using the same host/port/vhost? localhost, 5672, local?


--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.
To post to this group, send email to masstransit-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/7c1a81d7-a0f0-4967-be11-cc2dcc8f0400%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Wil Jones

unread,
May 16, 2017, 5:03:44 AM5/16/17
to masstransit-discuss
Yes the bus configuration is the same host, port and vhost.
To post to this group, send email to masstrans...@googlegroups.com.

Chris Patterson

unread,
May 16, 2017, 10:08:43 AM5/16/17
to masstrans...@googlegroups.com
I'd need to see more code to really figure it out, particularly the side scheduling the message.

To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsubscribe...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages