Detail data from an Enqueued job

dashboard
Tags: #<Tag:0x00007f788cabebe8>

#1

Problem: I would like to display information that is occurring WITHIN a job running on the backgroundserver such as record counts (counter) for each time a message is dequeued (subscribed) or queued (published), as for instance.

Server side:
On a very high level using SignalR and Hangfire & AspNetCore 2.1
Create a SignalR Hub
It’s my understanding, that when a job is enqueued, the hub context may
be provided to job, allowing communication between the Hangfire job and the SignalR Hub
As the Hangfire job starts to consume RabbitMQ messages for instance, a counter is
incremented and a counter message is sent to the SignalR hub.

Client side:
Using Javascript, JQuery, Razor Pages etc… Subscribe to the SignalR hub (SignalR can provide the actual scripts) and render message appropriately.

My questions are? Does this sound like a lucid approach, or does such functionality
already exist in Hangfire? Would I be able to leverage the existing Dashboard in this scenario?
Also would retries or recurring jobs also be able incorporate utilize a hub context?


#2

If you take a look at the Hangfire.Console extension:

That features a lot of tracing/progress options.


#3

Thanks Ben!

Great suggestion and I assume it can be incorporated in the Hangfire dashboard as well? I had a RabbitMQ Consumer/Producer in mind and since it’s a continuous job I’d find another way to represent activity (you mentioned passing a count).