Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the configuration method of Quartz.NET remote scheduling

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "what is the configuration method of Quartz.NET remote scheduling". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

1. Configure Quartz.NET remote execution

Configure the exit of the remote call Quartz on the server where the task is scheduled, and add the following configuration to quartz.config

# export this server to remoting context quartz.scheduler.exporter.type = Quartz.Simpl.RemotingSchedulerExporter, Quartz quartz.scheduler.exporter.port = 555 quartz.scheduler.exporter.bindName = QuartzScheduler quartz.scheduler.exporter.channelType = tcp quartz.scheduler.exporter.channelName = httpQuartz

1. The address of the client's "quartz.scheduler.proxy.address" configuration consists of channelType,port and bindName configured on the server. Pay attention to consistency.

two。 When the server initializes and starts, the process of launching the relevant Job from the database is not detailed here. Next time I introduce my own task scheduling platform, I will talk about it in more detail.

3. On the Job server, even a service host controls and schedules all job execution plans in the background.

two。 Manage client

A) create a background managed client, which can be a web website. It could be something else.

Initialize all Scheduler on the remote server

Private static IScheduler scheduler = null; public static void InitRemoteScheduler () {try {NameValueCollection properties = new NameValueCollection (); properties ["quartz.scheduler.instanceName"] = "schedMaintenanceService"; properties ["quartz.scheduler.proxy"] = "true" Properties ["quartz.scheduler.proxy.address"] = string.Format ("{0}: / / {1}: {2} / QuartzScheduler", scheme, server, port); ISchedulerFactory sf = new StdSchedulerFactory (properties)

Scheduler = sf.GetScheduler ();} catch (Exception ex) {LogHelper.WriteLog ("failed to initialize remote task manager" + ex.StackTrace);}}

B) add, pause, delete, etc.

/ / suspend the task / public static void PauseJob (string JobKey) {try {JobKey jk = new JobKey (JobKey); if (scheduler.CheckExists (jk)) {/ / suspend the task scheduler.PauseJob (jk) if the task already exists LogHelper.WriteLog (string.Format ("Task" {0} "paused", JobKey));} catch (Exception ex) {throw ex;}} "what is the configuration method of Quartz.NET remote scheduling"? thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report