kandi background
Explore Kits

quartz | Code for Quartz Scheduler | Job Scheduling library

 by   quartz-scheduler Java Version: v2.3.2 License: Apache-2.0

 by   quartz-scheduler Java Version: v2.3.2 License: Apache-2.0

Download this library from

kandi X-RAY | quartz Summary

quartz is a Java library typically used in Data Processing, Job Scheduling applications. quartz has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has high support. You can download it from GitHub, GitLab, Maven.
Code for Quartz Scheduler
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • quartz has a highly active ecosystem.
  • It has 4861 star(s) with 1632 fork(s). There are 229 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 21 open issues and 472 have been closed. On average issues are closed in 292 days. There are 3 open pull requests and 0 closed requests.
  • It has a positive sentiment in the developer community.
  • The latest version of quartz is v2.3.2
quartz Support
Best in #Job Scheduling
Average in #Job Scheduling
quartz Support
Best in #Job Scheduling
Average in #Job Scheduling

quality kandi Quality

  • quartz has 0 bugs and 0 code smells.
quartz Quality
Best in #Job Scheduling
Average in #Job Scheduling
quartz Quality
Best in #Job Scheduling
Average in #Job Scheduling

securitySecurity

  • quartz has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • quartz code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
quartz Security
Best in #Job Scheduling
Average in #Job Scheduling
quartz Security
Best in #Job Scheduling
Average in #Job Scheduling

license License

  • quartz is licensed under the Apache-2.0 License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
quartz License
Best in #Job Scheduling
Average in #Job Scheduling
quartz License
Best in #Job Scheduling
Average in #Job Scheduling

buildReuse

  • quartz releases are available to install and integrate.
  • Deployable package is available in Maven.
  • Build file is available. You can build the component from source.
  • quartz saves you 25674 person hours of effort in developing the same functionality from scratch.
  • It has 49985 lines of code, 4609 functions and 531 files.
  • It has medium code complexity. Code complexity directly impacts maintainability of the code.
quartz Reuse
Best in #Job Scheduling
Average in #Job Scheduling
quartz Reuse
Best in #Job Scheduling
Average in #Job Scheduling
Top functions reviewed by kandi - BETA

kandi has reviewed quartz and discovered the below as its top functions. This is intended to give you an instant insight into quartz implemented functionality, and help decide if they suit your requirements.

  • Main run method
  • store expressions in a string .
  • Sets the bean properties .
  • Creates a cron expression for the given week and time .
  • Select a trigger .
  • Initialize the scheduler .
  • Retrieves the triggers associated with the given list of triggers .
  • Initialize the scheduler servlet .
  • Called when a job is triggered .
  • Returns a summary of the scheduler .

quartz Key Features

Code for Quartz Scheduler

How to use Quartz.net with F#

copy iconCopydownload iconDownload
open System
open System.Threading.Tasks

open Quartz
open Quartz.Impl

type Job() =
    interface IJob with
        member _.Execute(_context) =
            Console.Out.WriteLineAsync(DateTime.Now.ToString())

task {
    // Grab the Scheduler instance from the Factory
    let factory = StdSchedulerFactory()
    let! scheduler = factory.GetScheduler()

    // and start it off
    do! scheduler.Start()

    // define the job and tie it to our Job class
    let job =
        JobBuilder.Create<Job>()
            .WithIdentity("job1", "group1")
            .Build()

    // Trigger the job to run now, and then repeat every second
    let trigger =
        TriggerBuilder.Create()
            .WithIdentity("trigger1", "group1")
            .StartNow()
            .WithSimpleSchedule(fun x ->
                x.WithIntervalInSeconds(1).RepeatForever()
                    |> ignore)
            .Build()

    // Tell quartz to schedule the job using our trigger
    let! _offset = scheduler.ScheduleJob(job, trigger)

    // some sleep to show what's happening
    do! Task.Delay(TimeSpan.FromSeconds(10))

    // and last shut down the scheduler when you are ready to close your program
    do! scheduler.Shutdown()
} |> ignore

Console.ReadLine() |> ignore
4/16/2022 6:11:52 PM
4/16/2022 6:11:52 PM
4/16/2022 6:11:53 PM
4/16/2022 6:11:54 PM
4/16/2022 6:11:55 PM
4/16/2022 6:11:56 PM
4/16/2022 6:11:57 PM
4/16/2022 6:11:58 PM
4/16/2022 6:11:59 PM
4/16/2022 6:12:00 PM
4/16/2022 6:12:01 PM
-----------------------
open System
open System.Threading.Tasks

open Quartz
open Quartz.Impl

type Job() =
    interface IJob with
        member _.Execute(_context) =
            Console.Out.WriteLineAsync(DateTime.Now.ToString())

task {
    // Grab the Scheduler instance from the Factory
    let factory = StdSchedulerFactory()
    let! scheduler = factory.GetScheduler()

    // and start it off
    do! scheduler.Start()

    // define the job and tie it to our Job class
    let job =
        JobBuilder.Create<Job>()
            .WithIdentity("job1", "group1")
            .Build()

    // Trigger the job to run now, and then repeat every second
    let trigger =
        TriggerBuilder.Create()
            .WithIdentity("trigger1", "group1")
            .StartNow()
            .WithSimpleSchedule(fun x ->
                x.WithIntervalInSeconds(1).RepeatForever()
                    |> ignore)
            .Build()

    // Tell quartz to schedule the job using our trigger
    let! _offset = scheduler.ScheduleJob(job, trigger)

    // some sleep to show what's happening
    do! Task.Delay(TimeSpan.FromSeconds(10))

    // and last shut down the scheduler when you are ready to close your program
    do! scheduler.Shutdown()
} |> ignore

Console.ReadLine() |> ignore
4/16/2022 6:11:52 PM
4/16/2022 6:11:52 PM
4/16/2022 6:11:53 PM
4/16/2022 6:11:54 PM
4/16/2022 6:11:55 PM
4/16/2022 6:11:56 PM
4/16/2022 6:11:57 PM
4/16/2022 6:11:58 PM
4/16/2022 6:11:59 PM
4/16/2022 6:12:00 PM
4/16/2022 6:12:01 PM

Cairo_quartz_font giving Undefined symbols for architecture x86_64 error

copy iconCopydownload iconDownload
    "-framework ApplicationServices"
    "-framework OpenGL"

Swift: understanding pointers

copy iconCopydownload iconDownload
var writeContext = CGContext(outURL, mediaBox: &myCGRectangle, nil)
-----------------------
var mediaBox = CGRect(x: 0, y: 0, width: 300, height: 500)
...
var writeContext = CGContext(outURL, mediaBox: &mediaBox, nil)

Execution optimizations have been disabled for task ':compileGsonViews'

copy iconCopydownload iconDownload
tasks.named('bootWarMainClassName') {
    it.mustRunAfter(tasks.named('compileGsonViews'))
}

SwaggerWelcomeCommon could not be found

copy iconCopydownload iconDownload
@Bean
@ConditionalOnMissingBean
@ConditionalOnProperty(
    name = {"springdoc.use-management-port"},
    havingValue = "false",
    matchIfMissing = true
)
SwaggerWelcomeWebMvc swaggerWelcome(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties, SwaggerUiConfigParameters swaggerUiConfigParameters, SpringWebProvider springWebProvider) {
    return new SwaggerWelcomeWebMvc(swaggerUiConfig, springDocConfigProperties, swaggerUiConfigParameters, springWebProvider);
}

Creating a combined single barplot or histogram from two different charts with bars side by side for years 1 &amp; 2

copy iconCopydownload iconDownload
 totaldisease %>% 
  tidyr::pivot_longer(names_to = "dis", values_to = "val",
                      cols = 1:ncol(.)) %>% 
  ggplot(aes(val, fill=dis))+
  geom_histogram(binwidth = 10)+
  labs(title = "Disease Year 1 & 2",
       y = "count", x = "% of disease") +
  theme(text = element_text(size = 10, family = "GillSans"))
totaldisease %>% 
  tidyr::pivot_longer(names_to = "dis", values_to = "val",
                      cols = 1:ncol(.)) %>% 
  ggplot(aes(val, fill=dis))+
  geom_histogram(binwidth = 10, position = "dodge")+
  labs(title = "Disease Year 1 & 2",
       y = "count", x = "% of disease") +
  theme(text = element_text(size = 10, family = "GillSans"))
-----------------------
 totaldisease %>% 
  tidyr::pivot_longer(names_to = "dis", values_to = "val",
                      cols = 1:ncol(.)) %>% 
  ggplot(aes(val, fill=dis))+
  geom_histogram(binwidth = 10)+
  labs(title = "Disease Year 1 & 2",
       y = "count", x = "% of disease") +
  theme(text = element_text(size = 10, family = "GillSans"))
totaldisease %>% 
  tidyr::pivot_longer(names_to = "dis", values_to = "val",
                      cols = 1:ncol(.)) %>% 
  ggplot(aes(val, fill=dis))+
  geom_histogram(binwidth = 10, position = "dodge")+
  labs(title = "Disease Year 1 & 2",
       y = "count", x = "% of disease") +
  theme(text = element_text(size = 10, family = "GillSans"))

C++: error: no member named 'signbit' in the global namespace

copy iconCopydownload iconDownload
#include <...> search starts here:
 /usr/local/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory)
// this was here before
#include <math.h>

// and I changed it to this
#include </Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h>
ld: library not found for -lre2
clang: error: linker command failed with exit code 1 (use -v to see invocation)
-----------------------
#include <...> search starts here:
 /usr/local/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory)
// this was here before
#include <math.h>

// and I changed it to this
#include </Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h>
ld: library not found for -lre2
clang: error: linker command failed with exit code 1 (use -v to see invocation)
-----------------------
#include <...> search starts here:
 /usr/local/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory)
// this was here before
#include <math.h>

// and I changed it to this
#include </Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h>
ld: library not found for -lre2
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Trigger Quartz.net job manually from controller

copy iconCopydownload iconDownload
[ApiController]
[Route("[controller]")]
public class QuartzController : ControllerBase {
    private readonly ISchedulerFactory factory;
    private readonly ILogger<WeatherForecastController> _logger;

    public QuartzController(ISchedulerFactory factory, ILogger<WeatherForecastController> logger) {
        this.factory = factory;
        _logger = logger;
    }

    [HttpGet("Run")]
    public async Task<OkObjectResult> Run(string jobName) {
        IScheduler scheduler = await factory.GetScheduler();

        //...check if a specific job exists

        //if yes then run that job
        await scheduler.TriggerJob(new JobKey("HelloWorldJob"));

        return Ok("OK");
    }
}

Quartz.net Scheduler.Shutdown(true) not killing jobs

copy iconCopydownload iconDownload
var props = new NameValueCollection
{
    {"quartz.scheduler.interruptJobsOnShutdownWithWait", "true"},
};

var scheduler = AsyncContext.Run(async () => await new StdSchedulerFactory(props).GetScheduler());
await this.scheduler.Shutdown(waitForJobsToComplete: true, cancellationToken);
public static Task Main(string[] args)
{
    using (var host = CreateHostBuilder(args)
        .UseSerilog<Settings>(Settings.Name)
        .UseConsoleLifetime()
        .Build()
        .UseSimpleInjector(container))
    {
        var logger = container.GetInstance<ILogger<Program>>();

        try
        {
            await host.RunAsync();

            var scheduller = container.GetInstance<IScheduler<Program>>();
            scheduller.Shutdown(true);
        }
        catch (Exception ex)
        {
            logger.LogCritical(ex, ex.Message);
        }

        logger.LogDebug($"Finish {nameof(Main)}().");
    }
}
-----------------------
var props = new NameValueCollection
{
    {"quartz.scheduler.interruptJobsOnShutdownWithWait", "true"},
};

var scheduler = AsyncContext.Run(async () => await new StdSchedulerFactory(props).GetScheduler());
await this.scheduler.Shutdown(waitForJobsToComplete: true, cancellationToken);
public static Task Main(string[] args)
{
    using (var host = CreateHostBuilder(args)
        .UseSerilog<Settings>(Settings.Name)
        .UseConsoleLifetime()
        .Build()
        .UseSimpleInjector(container))
    {
        var logger = container.GetInstance<ILogger<Program>>();

        try
        {
            await host.RunAsync();

            var scheduller = container.GetInstance<IScheduler<Program>>();
            scheduller.Shutdown(true);
        }
        catch (Exception ex)
        {
            logger.LogCritical(ex, ex.Message);
        }

        logger.LogDebug($"Finish {nameof(Main)}().");
    }
}
-----------------------
var props = new NameValueCollection
{
    {"quartz.scheduler.interruptJobsOnShutdownWithWait", "true"},
};

var scheduler = AsyncContext.Run(async () => await new StdSchedulerFactory(props).GetScheduler());
await this.scheduler.Shutdown(waitForJobsToComplete: true, cancellationToken);
public static Task Main(string[] args)
{
    using (var host = CreateHostBuilder(args)
        .UseSerilog<Settings>(Settings.Name)
        .UseConsoleLifetime()
        .Build()
        .UseSimpleInjector(container))
    {
        var logger = container.GetInstance<ILogger<Program>>();

        try
        {
            await host.RunAsync();

            var scheduller = container.GetInstance<IScheduler<Program>>();
            scheduller.Shutdown(true);
        }
        catch (Exception ex)
        {
            logger.LogCritical(ex, ex.Message);
        }

        logger.LogDebug($"Finish {nameof(Main)}().");
    }
}

Configure Data Source in Spring boot

copy iconCopydownload iconDownload
db_driverClassName=org.postgresql.Driver
db_url=jdbc:postgresql://localhost:5432/testDB
db_username=postgres
db_userpassword=password
-----------------------
@PropertySource("file:D:\\Spring Workspace\\test\\dbconfig.properties")

Community Discussions

Trending Discussions on quartz
  • How to use Quartz.net with F#
  • Cairo_quartz_font giving Undefined symbols for architecture x86_64 error
  • Swift: understanding pointers
  • Execution optimizations have been disabled for task ':compileGsonViews'
  • SwaggerWelcomeCommon could not be found
  • Escaping hyphen in MySQL query (not using a backtick)
  • Creating a combined single barplot or histogram from two different charts with bars side by side for years 1 &amp; 2
  • C++: error: no member named 'signbit' in the global namespace
  • How to start a scheduled job using Quartz.Net?
  • How to schedule quartz job to run every 3 business days?
Trending Discussions on quartz

QUESTION

How to use Quartz.net with F#

Asked 2022-Apr-16 at 22:12

I cannot make F# to schedule simple scheduler based on this .

open System
open Quartz
open Quartz.Impl

let schedulerFactory = StdSchedulerFactory()
let scheduler  = schedulerFactory.GetScheduler()
scheduler.Start()

type Job () =

    interface IJob with

        member x.Execute(context: IJobExecutionContext) =
            task{       //
                Console.WriteLine(DateTime.Now)
            }

let job = JobBuilder.Create<Job>().Build() //Exception Unhandled error!

let trigger =
    TriggerBuilder.Create()
        .WithSimpleSchedule(fun x ->
            x.WithIntervalInSeconds(1).RepeatForever() |> ignore)
        .Build()

scheduler.Result.ScheduleJob(job, trigger) |> ignore
Threading.Thread.Sleep(10000000)
Console.ReadKey()|>ignore

It gives runtime error for line let job = JobBuilder.Create<Job>().Build() System.InvalidOperationException: 'Start may not be called on a task that has completed.'

I also have had to change the scheduler.ScheduleJob to the scheduler.Result.ScheduleJob(.. from the original example above.

ANSWER

Answered 2022-Apr-16 at 22:12

Based on the documentation that Bent pointed to, I think this should do it, using the task builder from F# 6:

open System
open System.Threading.Tasks

open Quartz
open Quartz.Impl

type Job() =
    interface IJob with
        member _.Execute(_context) =
            Console.Out.WriteLineAsync(DateTime.Now.ToString())

task {
    // Grab the Scheduler instance from the Factory
    let factory = StdSchedulerFactory()
    let! scheduler = factory.GetScheduler()

    // and start it off
    do! scheduler.Start()

    // define the job and tie it to our Job class
    let job =
        JobBuilder.Create<Job>()
            .WithIdentity("job1", "group1")
            .Build()

    // Trigger the job to run now, and then repeat every second
    let trigger =
        TriggerBuilder.Create()
            .WithIdentity("trigger1", "group1")
            .StartNow()
            .WithSimpleSchedule(fun x ->
                x.WithIntervalInSeconds(1).RepeatForever()
                    |> ignore)
            .Build()

    // Tell quartz to schedule the job using our trigger
    let! _offset = scheduler.ScheduleJob(job, trigger)

    // some sleep to show what's happening
    do! Task.Delay(TimeSpan.FromSeconds(10))

    // and last shut down the scheduler when you are ready to close your program
    do! scheduler.Shutdown()
} |> ignore

Console.ReadLine() |> ignore

Output is something like:

4/16/2022 6:11:52 PM
4/16/2022 6:11:52 PM
4/16/2022 6:11:53 PM
4/16/2022 6:11:54 PM
4/16/2022 6:11:55 PM
4/16/2022 6:11:56 PM
4/16/2022 6:11:57 PM
4/16/2022 6:11:58 PM
4/16/2022 6:11:59 PM
4/16/2022 6:12:00 PM
4/16/2022 6:12:01 PM

Source https://stackoverflow.com/questions/71896560

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install quartz

You can download it from GitHub, GitLab, Maven.
You can use quartz like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the quartz component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

Support

For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Explore Related Topics

Share this Page

share link
Try Top Libraries by quartz-scheduler
Compare Job Scheduling Libraries with Highest Support
Compare Job Scheduling Libraries with Highest Reuse
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.