Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: Qurtz.net, Composite C1 and Azure

$
0
0

Hello,

I'm just started with running Composite C1 in the cloud, and we've chosen Azure as a our cloud platform of course.

Everything runs smoothly and everything is working, but we want to integrate a scheduled job for doing some imports/exports on a regular basis.

Running it with Quartz.net seemed like a good idea, I've hooked it up through a separate class library project with the ApplicationStartupAttribute from Composite Core -- and it runs seamless in our local environments. However, when I upload this to Azure, the reload time is a couple of minutes (usually it's 30 sec) and when it's done the site is dead. But, the jobs them selfs are being processed at least once.

What could I be doing wrong? Has anyone used Quartz.net on Azure, using the ApplicationStartupAttribute successfully?

I've seen other examples for scheduled jobs on Azure using Worker Roles, but that means I have to rewrite a lot in the project using the Azure SDK (which I haven't used) as it looks.

My hook in web.config;

<configSections>
        <section name="quartz" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    </configSections>
    ...
    <quartz>
        <add key="quartz.scheduler.instanceName" value="ImportScheduler" />
        
        <add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz" />
        <add key="quartz.threadPool.threadCount" value="10" />
        <add key="quartz.threadPool.threadPriority" value="Normal" />
        
        <add key="quartz.jobStore.misfireThreshold" value="60000" />
        <add key="quartz.jobStore.type" value="Quartz.Simpl.RAMJobStore, Quartz" />
        <add key="quartz.plugin.xml.type" value="Quartz.Plugin.Xml.XMLSchedulingDataProcessorPlugin, Quartz" />
    </quartz>

The startup handler;

namespace MyProject.Scheduled
{
    [ApplicationStartup]
    public class ScheduledStartupHandler
    {
        private static IScheduler _scheduler = null;

        public static void OnBeforeInitialize()
        {

        }

        public static void OnInitialized()
        {

            // Starting jobs here

        }
    }
}

Viewing all articles
Browse latest Browse all 2540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>