Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quartz Background Job not serializing Job Args #7189

Closed
angelcalvasp opened this issue Jan 13, 2021 · 2 comments
Closed

Quartz Background Job not serializing Job Args #7189

angelcalvasp opened this issue Jan 13, 2021 · 2 comments
Assignees
Milestone

Comments

@angelcalvasp
Copy link

ABP Version

3.3.1

I am using Quartz.net for background jobs management

I am queing a new job like so

await _backgroundJobManager.EnqueueAsync(
                new EcuadorEInvoicingEmailSendingArgs
                {
                    ComprobanteElectronicoId = comprobanteElectronico.Id,
                    TenantId = CurrentTenant.Id.Value
                }
            );

but I am getting the following error

Couldn't store job: JobDataMap values must be strings when the 'useProperties' property is set. Key of offending value: TArgs
Quartz.JobPersistenceException: Couldn't store job: JobDataMap values must be strings when the 'useProperties' property is set. Key of offending value: TArgs
---> System.IO.IOException: JobDataMap values must be strings when the 'useProperties' property is set. Key of offending value: TArgs

configuration is as follows

PreConfigure<AbpQuartzOptions>(options =>
            {
                options.Configurator = configure =>
                {
                    configure.UsePersistentStore(storeOptions =>
                    {
                        storeOptions.UseProperties = true;
                        storeOptions.UseSqlServer(configuration.GetConnectionString("Default"));
                        storeOptions.UseClustering(c =>
                        {
                            c.CheckinMisfireThreshold = TimeSpan.FromSeconds(20);
                            c.CheckinInterval = TimeSpan.FromSeconds(10);
                        });
                        storeOptions.UseJsonSerializer();
                    });
                };
            });

The argument itself is:

    [BackgroundJobName("eInvoicingEcuadoremails")]
    public class EcuadorEInvoicingEmailSendingArgs
    {
        public Guid ComprobanteElectronicoId { get; set; }
        public Guid TenantId { get; set; }
    }

I am following what is on the docs, but I seem to be missing something, am I configuring wrong the module? should the argument be annotated with something so that it gets serialized correctly?

@realLiangshiwei realLiangshiwei self-assigned this Jan 14, 2021
@realLiangshiwei
Copy link
Member

I will check it out

@realLiangshiwei
Copy link
Member

We have fixed this problem, for now, you can UseProperties value to false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants