SORU
31 AĞUSTOS 2009, PAZARTESİ


Nasıl ASP.NET ile Quartz.net kullanmak için

ASP.NET içinde Quartz.dll nasıl kullanılacağını bilmiyorum. Nerede tetik posta zamanlama işleri için kodu her sabah yazılır? Eğer bazı vücut hakkında bir şey bilen varsa lütfen yardımcı olurmusunuz...

Düzenleme:HOW TO use Quartz.NET in PRO way? gerçekten yararlı olduğu bulundu.

CEVAP
2 EYLÜL 2009, ÇARŞAMBA


Birkaç seçenek, ne yapmak istediğini ve bunu kurmak istiyorum nasıl bağlı. Örneğin, tek başına windows serviceor olarak Quartz.Net bir server kurabilirsiniz da ASP.NET uygulamanız içine gömebilirsiniz.

Eğer gömülü çalıştırmak istiyorsanız, o zaman sizin küresel söyle sunucudan başlayabilirsiniz.asax, bu gibi kaynak kod örnekleri örneği #12):

NameValueCollection properties = new NameValueCollection();
properties["quartz.scheduler.instanceName"] = "RemoteServer";

// set thread pool info
properties["quartz.threadPool.type"] = "Quartz.Simpl.SimpleThreadPool, Quartz";
properties["quartz.threadPool.threadCount"] = "5";
properties["quartz.threadPool.threadPriority"] = "Normal";

ISchedulerFactory sf = new StdSchedulerFactory(properties);
IScheduler sched = sf.GetScheduler();
sched.Start();

Bir hizmet olarak çalıştırmak, uzaktan böyle (örnek 12) bağlayın:

NameValueCollection properties = new NameValueCollection();
properties["quartz.scheduler.instanceName"] = "RemoteClient";

// set thread pool info
properties["quartz.threadPool.type"] = "Quartz.Simpl.SimpleThreadPool, Quartz";
properties["quartz.threadPool.threadCount"] = "5";
properties["quartz.threadPool.threadPriority"] = "Normal";

// set remoting expoter
properties["quartz.scheduler.proxy"] = "true";
properties["quartz.scheduler.proxy.address"] = "tcp://localhost:555/QuartzScheduler";
// First we must get a reference to a scheduler
ISchedulerFactory sf = new StdSchedulerFactory(properties);
IScheduler sched = sf.GetScheduler();

Zamanlayıcı (gömülü bir örneği olması nedeniyle uzak üzerinden veya olmak) bir başvuru için bir iş zamanlayabilirsiniz:

// define the job and ask it to run
JobDetail job = new JobDetail("remotelyAddedJob", "default", typeof(SimpleJob));
JobDataMap map = new JobDataMap();
map.Put("msg", "Your remotely added job has executed!");
job.JobDataMap = map;
CronTrigger trigger = new CronTrigger("remotelyAddedTrigger", "default", "remotelyAddedJob", "default", DateTime.UtcNow, null, "/5 * * ? * *");
// schedule the job
sched.ScheduleJob(job, trigger);

İşte insanlar Quartz.Net başlarken yazdığım bazı yazılara link: http://jvilalta.blogspot.com/2009/03/getting-started-with-quartznet-part-1.html

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Doc Adams

    Doc Adams

    20 HAZİRAN 2007
  • GFX Tutorials

    GFX Tutorial

    12 AĞUSTOS 2013
  • UrAvgConsumer

    UrAvgConsume

    1 Ocak 2012