With dynamic queue name, after I enqueue them, I use Requeue method so could fire them processing. But got problem job that is created by ContinueWith. There is no way to Requeue after parent job finished and child job is enqueued. Here is my code:
IBackgroundJobClient client = new BackgroundJobClient();
IState state = new EnqueuedState
{
Queue = “my-queue”
};
var hangfireJobId = client.Create(() => Console.WriteLine(“Normal Job”), state);
client.Requeue(hangfireJobId, Hangfire.States.EnqueuedState.StateName);
var childHangfireJobId = client.ContinueWith(latestHangfireJobId, () => Console.WriteLine(“Continue Job”), state, JobContinuationOptions.OnAnyFinishedState);