Suppose we have two different apps with two difference Dashboards one of them uses Redis Database 0 and enqueue Methods in specific Queue named QueueX , and the other app Uses Redis Database 1 and Redis Server with it’s queue named QueueX.
The first one should only enqueue Some Jobs, then the enqueued jobs should be proceeded in Second Dashboard.
First app:
GlobalConfiguration.Configuration.UseRedisStorage("localhost",
new Hangfire.Pro.Redis.RedisStorageOptions()
{
InvisibilityTimeout = TimeSpan.MaxValue,
Database = 0
}).UseConsole();
Second app:
I think if I established both of them in Single Redis Db then it will works like a charm, but problem is Different Redist Db number.
appBuilder.UseHangfireServer(new BackgroundJobServerOptions
{
ServerName = $"ServerX",
WorkerCount = 2,
Queues = new[] { "QueueX" }
});
.....
.....
.....
GlobalConfiguration.Configuration.UseRedisStorage("localhost",
new Hangfire.Pro.Redis.RedisStorageOptions()
{
InvisibilityTimeout = TimeSpan.MaxValue,
Database = 1,
Prefix = "hangfire:app2:",
}).UseConsole();
and the method in app1 :
[Queue("QueueX")]
public static void Method1(){}
So Scenario is something like below:
Dasboard1 established on Redis Db 0 and then Method1 => Enqueue-ed on QueueX at runtime
Dasboard2 established on Redis Db 1 with HangfireServer named ServerX and QueueX.
The FetchNextJob
here Hangfire.Redis/RedisConnection.cs at master · HangfireIO/Hangfire.Redis · GitHub will fetch job based Db prefix not Db number
Is there a way to enqueue job in pecific Db? or something else.