Remote MSMQ and Web Dashboard

I am using the following setup for my hangfire environment and am running into an issue trying to access the Hangfire Dashboard Job Queues.

I have a 3 server setup, web, app, and database. The web houses my MVC project and serves the dashboard. The app server is where my private transactional MSMQ queues are setup along with the Windows Service to process requests. I am using Hangfire 1.4.3 with MSMQ (of course, but hey…)

When i try to visit the job queues page /jobs/enqueued/ I get the following error and corresponding stack trace:

[InvalidOperationException: Cannot determine whether a queue with the specified format name exists.]

System.Messaging.MessageQueue.Exists(String path) +230562
Rsft.Lib.Msmq.MessageCounter.MessageQueueExtensions.GetCount(String path) +105
Hangfire.SqlServer.Msmq.MsmqJobQueueMonitoringApi.GetEnqueuedAndFetchedCount(String queue) +111
Hangfire.SqlServer.SqlServerMonitoringApi.<Queues>b__2d(SqlConnection connection) +727
Hangfire.SqlServer.SqlServerMonitoringApi.UseConnection(Func`2 action) +218
Hangfire.Dashboard.Pages.QueuesPage.Execute() +269
Hangfire.Dashboard.RazorPage.TransformText(String body) +41
Hangfire.Dashboard.RazorPageDispatcher.Dispatch(RequestDispatcherContext context) +236
Hangfire.Dashboard.<>c__DisplayClass8.<UseHangfireDashboard>b__4(IDictionary`2 env) +535
Microsoft.Owin.Infrastructure.AppFuncTransition.Invoke(IOwinContext context) +41
Microsoft.Owin.Mapping.<Invoke>d__0.MoveNext() +611
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +144
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +84
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.<RunApp>d__5.MoveNext() +291
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +144
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +84
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.<DoFinalWork>d__2.MoveNext() +293
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32    Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.EndFinalWork(IAsyncResult ar) +208
System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +434
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288

This is due to MSMQ not able to determine if a remote private queue exists

Any way this can be fixed using the suggested iteration of remote private queues for the names to verify they exist?

Thanks

1 Like

Hi @underwhelmed, remote private MSMQ queues were not supported in previous versions. I’ve just released 1.5.0-beta1, and now they work fine. I’ve fixed MessageQueueExtensions.GetCount method as well.