Quartz.NET 中的职位详细信息
今天我问了很多关于 Quartz.NET 的问题,但我在理解方面取得了进展,并且非常感谢你们对我的帮助。我现在想我明白了这些工作是如何运作的,但我有一个问题。
对于每个作业,他们需要在“QRTZ_JOB_DETAILS”中有 3-4 个额外字段,例如路径名等。我添加了这些,但是如何在作业中访问这些信息,以便我可以使用这些字段中的数据来携带失业了?例如,作业需要将文件移动到指定的路径,但我不确定如何从该列中提取信息。
对于 Quartz.NET 中内置的列,我知道如何访问它们,方法是执行以下操作:
public virtual void Execute(JobExecutionContext context)
{
string isvolatile = context.JobDetail.Volatile.ToString();
System.Console.WriteLine(isvolatile);
}
但对于我添加的新列,似乎不存在任何方法。我如何访问这些?
I've asked questions about Quartz.NET a lot today, but I'm making progress in understand and really appreciate you guys helping me. I now think I understand how the jobs work but I have one issue.
For each job, they need to have 3-4 extra fields in the 'QRTZ_JOB_DETAILS', such as pathnames etc. I added these in, but how do I access this information in the jobs so I can use the data in these fields to carry out the job? For example, the job will need to move a file to the specified path, but I'm not sure how to pull the information from that column.
For the columns that are built into Quartz.NET, I know how to access these, which is by doing the following:
public virtual void Execute(JobExecutionContext context)
{
string isvolatile = context.JobDetail.Volatile.ToString();
System.Console.WriteLine(isvolatile);
}
But no methods seem to exist for the new columns I have added. How do I access these?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不要向 Quartz 表添加列,而是查看 JobDataMaps。这些保留在 QRTZ_JOB_DETAILS 表的 JOB_DATA 列中。
Instead of adding columns to Quartz tables, take a look at JobDataMaps. These are persisted in the JOB_DATA column of the QRTZ_JOB_DETAILS table.