Maik
Maik
CC#
Created by Maik on 1/17/2025 in #help
DI Service Usage in Quartz.NET registration
Why haven't I ever thought about that - The IConfigure<QuartzOptions> is a very good Idea - Thanks a lot, that will solve My Problem!
38 replies
CC#
Created by Maik on 1/17/2025 in #help
DI Service Usage in Quartz.NET registration
The appsettings looks like this
{
"ConnectionStrings": {
"Database": "Server=...;Port=....;Database=...;Username=%REPLACE_USERNAME%;Password=%REPLACE_PASSWORD%"
},
"Postgres": {
"Username": "Actual username value",
"Password": "Actual password value"
}
}
{
"ConnectionStrings": {
"Database": "Server=...;Port=....;Database=...;Username=%REPLACE_USERNAME%;Password=%REPLACE_PASSWORD%"
},
"Postgres": {
"Username": "Actual username value",
"Password": "Actual password value"
}
}
But the postgres section is being appended during startup from the vault and it can be rotated. So they are not always the same.
38 replies
CC#
Created by Maik on 1/17/2025 in #help
DI Service Usage in Quartz.NET registration
Yes and no. I don't have a "first" database there I get the actual connectionString from. The username and password for the quartz connectionString comes from a vault (hashicorp to be exact). But yes the general problem is receiving the connectionString during the quartz configuration. It might be possible to do quartz, but the user and passwords are rotated in the vault. Therefore my service will often use different credentials. Using IConfiguration the credentials would be fixed and couldn't be rotated other than with a service restart. The custom service providing the connection string allows me to always resolve the newest credentials without having to restart the service
38 replies
CC#
Created by Maik on 1/17/2025 in #help
DI Service Usage in Quartz.NET registration
I mean I got all parts of the connection string in the appsettings, since the vault secrets get appended to the appsettings during startup. But I cant access IConfiguration either since we already know there is no builtin serviceProvider support
38 replies
CC#
Created by Maik on 1/17/2025 in #help
DI Service Usage in Quartz.NET registration
Yes, but I don't see any other solution yet, since I must use the ISecretConnectionStringProvider service to receive the connectionString For example EntityFramework has a similar feature where you can access the ServiceProvider during .AddDbContext<T>
38 replies
CC#
Created by Maik on 1/17/2025 in #help
DI Service Usage in Quartz.NET registration
Ah now I do understand - I know that Quartz supports DI in the jobs - I am already using it there. But does Quartz also supports DI during it's configuration in the startup process
38 replies
CC#
Created by Maik on 1/17/2025 in #help
DI Service Usage in Quartz.NET registration
But why are there paid plans lol I am not very educated about hangfire - Do they offer a own service?
38 replies
CC#
Created by Maik on 1/17/2025 in #help
DI Service Usage in Quartz.NET registration
Oh bruh you are right. I only saw the prices and were like "nope"
38 replies
CC#
Created by Maik on 1/17/2025 in #help
DI Service Usage in Quartz.NET registration
Yes Hangfire is not free. Therefore no option for me at the moment. Sadly https://www.hangfire.io/pricing/
38 replies
CC#
Created by Maik on 1/17/2025 in #help
DI Service Usage in Quartz.NET registration
At least I've tested it several times in the cloud by now and it supports clustering out of the box aswell. Another reason why we are using it at the moment. Nonetheless we didn't have multiple replicas in production yet. We only tested it with multiple replicas so I can't give any warranty. See more here https://www.quartz-scheduler.net/documentation/quartz-2.x/tutorial/advanced-enterprise-features.html We also considered using Hangfire but hangfire has a license model when I remember correctly?
38 replies