Closed olicooper closed 4 years ago
Quartz.Net v3.1.0-beta2 looks good. It contains a lot of changes, I will try integrate.
The latest stable version of Quartz has just been released and it looks great! OpenTelemtry and TimeZoneConverter support now added too 👍
Update:
I have upgraded my own project to this release but there are issues when using MySql as the provider 😢
Volo.Abp.EntityFrameworkCore.MySQL
uses Pomelo.EntityframeworkCore.MySql @ v3.1.1
which depends on MySqlConnector < 1.0.0
, but Quartz requires MySqlConnector >= 1.0.0
, which causes a dependency conflict between the packages.
Pomelo are going to upgrade their MySqlConnector
dependancy to >= 1.0.0 but they won't be doing it until v5.0.0 (because it is a breaking change) which I assume aligns with the release of .NET 5 - so we could be waiting until November for this to be resolved! 😢
If we upgrade this package before .NET 5, there might be a way to fix the MySQL dependency problem by using a custom provider but I haven't looked in to it yet.
I have a few suggestions if that's okay?
Microsoft.Data.SqlClient
dependency and let the developer choose which provider they use (the same way that the core Quartz library does it).Quartz.Plugins.TimeZoneConverter
so that it integrates with the recent changes made here https://github.com/abpframework/abp/pull/39333.1.0
update.Configurator
if Properties
are specified i.e. in here: https://github.com/abpframework/abp/blob/46dbe7691070d88382d8afd6e3c740e82f8d4720/framework/src/Volo.Abp.Quartz/Volo/Abp/Quartz/AbpQuartzOptions.cs#L14-L16I have managed to work out how to use the custom provider. I tried creating one using configuration (i.e. appsettings.json
, quartz.config
, AbpQuartzOptions
) but these didn't work. In the end I managed to use the following:
var mySqlAvailable = System.Type.GetType("MySql.Data.MySqlClient.MySqlConnection, MySqlConnector") != null;
if (mySqlAvailable)
{
DbProvider.RegisterDbMetadata("AbpMySqlConnector", new DbMetadata()
{
ProductName = "MySQL, MySqlConnector provider",
AssemblyName = "MySqlConnector",
ConnectionType = System.Type.GetType("MySql.Data.MySqlClient.MySqlConnection, MySqlConnector"),
CommandType = System.Type.GetType("MySql.Data.MySqlClient.MySqlCommand, MySqlConnector"),
ParameterType = System.Type.GetType("MySql.Data.MySqlClient.MySqlParameter, MySqlConnector"),
ParameterDbType = System.Type.GetType("MySql.Data.MySqlClient.MySqlDbType, MySqlConnector"),
ParameterDbTypePropertyName = "MySqlDbType",
ParameterNamePrefix = "?",
ExceptionType = System.Type.GetType("MySql.Data.MySqlClient.MySqlException, MySqlConnector"),
BindByName = true,
DbBinaryTypeName = "Blob"
});
}
... And then use the data source using the Configurator options:
PreConfigure<AbpQuartzOptions>(options =>
{
options.Configurator = configure =>
{
configure.UsePersistentStore(storeOptions =>
{
storeOptions.UseGenericDatabase("AbpMySqlConnector", providerOptions =>
{
providerOptions.ConnectionString = configuration.GetConnectionString("Quartz");
providerOptions.TablePrefix = "QRTZ_";
});
});
};
});
I think this is more elegant and is easy to add to Abp too.
Hi @olicooper ,
Microsoft.Data.SqlClient
dependency, we will update when quartz version 3.2 is released
Version 3 is not official yet but there is a beta out with some great improvements v3.1.0-beta2
Features such as DI, MySQL connector and appsettings integration would be useful to utilize in abp. There are a number of bug fixes and performance improvements too.
I have been using a nightly version in my project for a while and it's been working great so there should be too many issues with upgrading it.