├── Quartz
├── Quartz.dll
└── Common.Logging.dll
├── QuartzNServiceBusSample.Messages
├── DoSomething.cs
├── packages.config
├── Properties
│ └── AssemblyInfo.cs
└── QuartzNServiceBusSample.Messages.csproj
├── QuartzNServiceBusSample.Host
├── EndpointConfig.cs
├── packages.config
├── DoSomethingHandler.cs
├── App.config
├── Properties
│ └── AssemblyInfo.cs
└── QuartzNServiceBusSample.Host.csproj
├── .gitattributes
├── QuartzNServiceBusSample
├── packages.config
├── QuartzService.cs
├── QuartzJobFactory.cs
├── DoSomethingSchedule.cs
├── ScheduleSetup.cs
├── EndpointConfig.cs
├── Properties
│ └── AssemblyInfo.cs
├── App.config
├── QuartzNServiceBusSample.Scheduler.csproj
└── QuartzTables.sql
├── README.md
├── .gitignore
└── QuartzNServiceBusSample.sln
/Quartz/Quartz.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jbogard/QuartzNServiceBusSample/HEAD/Quartz/Quartz.dll
--------------------------------------------------------------------------------
/Quartz/Common.Logging.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jbogard/QuartzNServiceBusSample/HEAD/Quartz/Common.Logging.dll
--------------------------------------------------------------------------------
/QuartzNServiceBusSample.Messages/DoSomething.cs:
--------------------------------------------------------------------------------
1 | using NServiceBus;
2 |
3 | namespace QuartzNServiceBusSample.Messages
4 | {
5 | public class DoSomething : IMessage
6 | {
7 |
8 | }
9 | }
--------------------------------------------------------------------------------
/QuartzNServiceBusSample.Host/EndpointConfig.cs:
--------------------------------------------------------------------------------
1 | using NServiceBus;
2 |
3 | namespace QuartzNServiceBusSample.Host
4 | {
5 | public class EndpointConfig : IConfigureThisEndpoint, AsA_Server
6 | {
7 |
8 | }
9 | }
--------------------------------------------------------------------------------
/QuartzNServiceBusSample.Messages/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/QuartzNServiceBusSample.Host/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.doc diff=astextplain
2 | *.DOC diff=astextplain
3 | *.docx diff=astextplain
4 | *.DOCX diff=astextplain
5 | *.dot diff=astextplain
6 | *.DOT diff=astextplain
7 | *.pdf diff=astextplain
8 | *.PDF diff=astextplain
9 | *.rtf diff=astextplain
10 | *.RTF diff=astextplain
11 |
12 | *.jpg binary
13 | *.png binary
14 | *.gif binary
15 |
16 | core.eol crlf
--------------------------------------------------------------------------------
/QuartzNServiceBusSample.Host/DoSomethingHandler.cs:
--------------------------------------------------------------------------------
1 | using NServiceBus;
2 | using QuartzNServiceBusSample.Messages;
3 | using log4net;
4 |
5 | namespace QuartzNServiceBusSample.Host
6 | {
7 | public class DoSomethingHandler : IHandleMessages
8 | {
9 | public void Handle(DoSomething message)
10 | {
11 | LogManager.GetLogger(this.GetType()).Info("Doing something");
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/QuartzNServiceBusSample/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/QuartzNServiceBusSample.Host/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/QuartzNServiceBusSample/QuartzService.cs:
--------------------------------------------------------------------------------
1 | using NServiceBus;
2 | using Quartz;
3 |
4 | namespace QuartzNServiceBusSample
5 | {
6 | public class QuartzService : IWantToRunAtStartup
7 | {
8 | private readonly IScheduler _scheduler;
9 |
10 | public QuartzService(IScheduler scheduler)
11 | {
12 | _scheduler = scheduler;
13 | }
14 |
15 | public void Run()
16 | {
17 | _scheduler.Start();
18 | }
19 |
20 | public void Stop()
21 | {
22 | _scheduler.Shutdown(true);
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/QuartzNServiceBusSample/QuartzJobFactory.cs:
--------------------------------------------------------------------------------
1 | using NServiceBus.ObjectBuilder;
2 | using NServiceBus.ObjectBuilder.Common;
3 | using Quartz;
4 | using Quartz.Spi;
5 |
6 | namespace QuartzNServiceBusSample
7 | {
8 | public class QuartzJobFactory : IJobFactory
9 | {
10 | private readonly IBuilder _container;
11 |
12 | public QuartzJobFactory(IBuilder container)
13 | {
14 | _container = container;
15 | }
16 |
17 | public IJob NewJob(TriggerFiredBundle bundle, IScheduler scheduler)
18 | {
19 | return _container.Build(bundle.JobDetail.JobType) as IJob;
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/QuartzNServiceBusSample/DoSomethingSchedule.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using NServiceBus;
3 | using NServiceBus.Installation;
4 | using Quartz;
5 | using QuartzNServiceBusSample.Messages;
6 |
7 | namespace QuartzNServiceBusSample
8 | {
9 | public class DoSomethingSchedule : ScheduleSetup
10 | {
11 | public DoSomethingSchedule(IScheduler scheduler) : base(scheduler)
12 | {
13 | }
14 |
15 | protected override TriggerBuilder CreateTrigger()
16 | {
17 | return TriggerBuilder.Create().WithCalendarIntervalSchedule(b => b.WithIntervalInSeconds(5));
18 | }
19 | }
20 |
21 | public class DoSomethingJob : IJob
22 | {
23 | public IBus Bus { get; set; }
24 |
25 | public void Execute(IJobExecutionContext context)
26 | {
27 | Bus.Send(new DoSomething());
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | QuartzNServiceBusSample
2 | =======================
3 |
4 | This is an example of using NServiceBus with Quartz.NET to trigger scheduled messages. NServiceBus has support for [scheduling periodic messages](http://nservicebus.com/Scheduling.aspx), but that doesn't allow things to happen on a certain date/time.
5 |
6 | Instead, we can use Quartz.NET to trigger messages on a cron-type schedule, like once a month, twice a day at 8 AM and 4 PM etc.
7 |
8 | To run:
9 |
10 | * Create a database named "QuartzNServiceBusSample" in your local .\SQLExpress instance. You can change the server/database name by modifying the App.config file in the QuartzNServiceBusSample.Scheduler project.
11 | * Run the QuartzTables.sql against that database
12 | * Open the solution and run
13 |
14 | The example uses a secondly trigger to trigger Quartz to send a message every 5 seconds. You can modify the trigger to build daily/monthly triggers.
--------------------------------------------------------------------------------
/QuartzNServiceBusSample/ScheduleSetup.cs:
--------------------------------------------------------------------------------
1 | using System.Security.Principal;
2 | using NServiceBus;
3 | using NServiceBus.Installation;
4 | using Quartz;
5 |
6 | namespace QuartzNServiceBusSample
7 | {
8 | public abstract class ScheduleSetup
9 | : IWantToRunAtStartup
10 | where TJob : IJob
11 | {
12 | private readonly IScheduler _scheduler;
13 |
14 | protected ScheduleSetup(IScheduler scheduler)
15 | {
16 | _scheduler = scheduler;
17 | }
18 |
19 | protected abstract TriggerBuilder CreateTrigger();
20 |
21 | public void Run()
22 | {
23 | var typeOfJob = typeof(TJob);
24 | var jobName = typeOfJob.Name;
25 | var jobKey = new JobKey(jobName);
26 |
27 | var jobDetail = JobBuilder.Create().WithIdentity(jobKey).Build();
28 | var trigger = CreateTrigger().ForJob(jobDetail).Build();
29 |
30 | if (_scheduler.GetJobDetail(jobKey) == null)
31 | {
32 | _scheduler.ScheduleJob(jobDetail, trigger);
33 | }
34 | else
35 | {
36 | var triggerName = typeof(TJob).Name + "-CronTrigger";
37 |
38 | _scheduler.RescheduleJob(new TriggerKey(triggerName), trigger);
39 | }
40 | }
41 |
42 | public void Stop()
43 | {
44 | }
45 | }
46 | }
--------------------------------------------------------------------------------
/QuartzNServiceBusSample/EndpointConfig.cs:
--------------------------------------------------------------------------------
1 | using NServiceBus;
2 | using NServiceBus.ObjectBuilder;
3 | using Quartz;
4 | using Quartz.Impl;
5 | using Quartz.Spi;
6 |
7 | namespace QuartzNServiceBusSample
8 | {
9 | public class EndpointConfig : IConfigureThisEndpoint, AsA_Client
10 | {
11 | }
12 |
13 | public class SendOnly : IWantCustomInitialization
14 | {
15 | public void Init()
16 | {
17 | Configure.Instance
18 | .SendOnly();
19 | }
20 | }
21 |
22 | public class QuartzConfiguration : IWantCustomInitialization
23 | {
24 | public void Init()
25 | {
26 | var configurer = Configure.Instance.Configurer;
27 | configurer
28 | .ConfigureComponent(
29 | () => new QuartzJobFactory(Configure.Instance.Builder),
30 | DependencyLifecycle.InstancePerUnitOfWork)
31 | ;
32 | configurer.ConfigureComponent(() =>
33 | {
34 | var factoryx = new StdSchedulerFactory();
35 | factoryx.Initialize();
36 |
37 | var scheduler = factoryx.GetScheduler();
38 | scheduler.JobFactory = Configure.Instance.Builder.Build();
39 | return scheduler;
40 |
41 | }, DependencyLifecycle.SingleInstance);
42 | configurer.ConfigureComponent(DependencyLifecycle.InstancePerUnitOfWork);
43 | }
44 | }
45 | }
--------------------------------------------------------------------------------
/QuartzNServiceBusSample/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("QuartzNServiceBusSample")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("QuartzNServiceBusSample")]
13 | [assembly: AssemblyCopyright("Copyright © 2012")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("19fc93ad-0bf4-4827-badd-0ee097b4d2c6")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/QuartzNServiceBusSample.Host/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("QuartzNServiceBusSample.Host")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("QuartzNServiceBusSample.Host")]
13 | [assembly: AssemblyCopyright("Copyright © 2012")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("8eb0da50-18c7-4e56-bc89-df65bbbb8ac5")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/QuartzNServiceBusSample.Messages/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("QuartzNServiceBusSample.Messages")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("QuartzNServiceBusSample.Messages")]
13 | [assembly: AssemblyCopyright("Copyright © 2012")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("628559f7-3134-4c6c-9cfd-b31d16424542")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/QuartzNServiceBusSample/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.sln.docstates
8 |
9 | # Build results
10 |
11 | [Dd]ebug*/
12 | [Rr]elease/
13 |
14 | build/
15 |
16 |
17 | [Tt]est[Rr]esult
18 | [Bb]uild[Ll]og.*
19 |
20 | *_i.c
21 | *_p.c
22 | *.ilk
23 | *.meta
24 | *.obj
25 | *.pch
26 | *.pdb
27 | *.pgc
28 | *.pgd
29 | *.rsp
30 | *.sbr
31 | *.tlb
32 | *.tli
33 | *.tlh
34 | *.tmp
35 | *.vspscc
36 | *.vssscc
37 | .builds
38 |
39 | *.pidb
40 |
41 | *.log
42 | *.scc
43 | # Visual C++ cache files
44 | ipch/
45 | *.aps
46 | *.ncb
47 | *.opensdf
48 | *.sdf
49 |
50 | # Visual Studio profiler
51 | *.psess
52 | *.vsp
53 |
54 | # Guidance Automation Toolkit
55 | *.gpState
56 |
57 | # ReSharper is a .NET coding add-in
58 | _ReSharper*/
59 |
60 | *.[Rr]e[Ss]harper
61 |
62 | # NCrunch
63 | *.ncrunch*
64 | .*crunch*.local.xml
65 |
66 | # Installshield output folder
67 | [Ee]xpress
68 |
69 | # DocProject is a documentation generator add-in
70 | DocProject/buildhelp/
71 | DocProject/Help/*.HxT
72 | DocProject/Help/*.HxC
73 | DocProject/Help/*.hhc
74 | DocProject/Help/*.hhk
75 | DocProject/Help/*.hhp
76 | DocProject/Help/Html2
77 | DocProject/Help/html
78 |
79 | # Click-Once directory
80 | publish
81 |
82 | # Publish Web Output
83 | *.Publish.xml
84 |
85 | # Others
86 | [Bb]in
87 | [Oo]bj
88 | sql
89 | TestResults
90 | [Tt]est[Rr]esult*
91 | *.Cache
92 | ClientBin
93 | [Ss]tyle[Cc]op.*
94 | ~$*
95 | *.dbmdl
96 |
97 | *.[Pp]ublish.xml
98 |
99 | Generated_Code #added for RIA/Silverlight projects
100 |
101 | # Backup & report files from converting an old project file to a newer
102 | # Visual Studio version. Backup files are not needed, because we have git ;-)
103 | _UpgradeReport_Files/
104 | Backup*/
105 | UpgradeLog*.XML
106 |
107 | # NuGet
108 | packages/
109 |
110 | # Office Temp Files
111 | ~$*
--------------------------------------------------------------------------------
/QuartzNServiceBusSample.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuartzNServiceBusSample.Scheduler", "QuartzNServiceBusSample\QuartzNServiceBusSample.Scheduler.csproj", "{92534EFD-D917-43AA-ABB3-0229B0575FEC}"
5 | EndProject
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuartzNServiceBusSample.Host", "QuartzNServiceBusSample.Host\QuartzNServiceBusSample.Host.csproj", "{BAE786AF-96DA-485B-91B4-98912F2F9C95}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuartzNServiceBusSample.Messages", "QuartzNServiceBusSample.Messages\QuartzNServiceBusSample.Messages.csproj", "{819A50C9-346E-4C2C-BB57-6F10FC60D482}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {92534EFD-D917-43AA-ABB3-0229B0575FEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {92534EFD-D917-43AA-ABB3-0229B0575FEC}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {92534EFD-D917-43AA-ABB3-0229B0575FEC}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {92534EFD-D917-43AA-ABB3-0229B0575FEC}.Release|Any CPU.Build.0 = Release|Any CPU
20 | {BAE786AF-96DA-485B-91B4-98912F2F9C95}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {BAE786AF-96DA-485B-91B4-98912F2F9C95}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {BAE786AF-96DA-485B-91B4-98912F2F9C95}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {BAE786AF-96DA-485B-91B4-98912F2F9C95}.Release|Any CPU.Build.0 = Release|Any CPU
24 | {819A50C9-346E-4C2C-BB57-6F10FC60D482}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25 | {819A50C9-346E-4C2C-BB57-6F10FC60D482}.Debug|Any CPU.Build.0 = Debug|Any CPU
26 | {819A50C9-346E-4C2C-BB57-6F10FC60D482}.Release|Any CPU.ActiveCfg = Release|Any CPU
27 | {819A50C9-346E-4C2C-BB57-6F10FC60D482}.Release|Any CPU.Build.0 = Release|Any CPU
28 | EndGlobalSection
29 | GlobalSection(SolutionProperties) = preSolution
30 | HideSolutionNode = FALSE
31 | EndGlobalSection
32 | EndGlobal
33 |
--------------------------------------------------------------------------------
/QuartzNServiceBusSample.Messages/QuartzNServiceBusSample.Messages.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {819A50C9-346E-4C2C-BB57-6F10FC60D482}
9 | Library
10 | Properties
11 | QuartzNServiceBusSample.Messages
12 | QuartzNServiceBusSample.Messages
13 | v4.0
14 | 512
15 |
16 |
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | pdbonly
27 | true
28 | bin\Release\
29 | TRACE
30 | prompt
31 | 4
32 |
33 |
34 |
35 | ..\packages\log4net.1.2.10\lib\2.0\log4net.dll
36 |
37 |
38 | ..\packages\NServiceBus.3.2.6\lib\net40\NServiceBus.dll
39 |
40 |
41 | ..\packages\NServiceBus.3.2.6\lib\net40\NServiceBus.Core.dll
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
66 |
--------------------------------------------------------------------------------
/QuartzNServiceBusSample.Host/QuartzNServiceBusSample.Host.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {BAE786AF-96DA-485B-91B4-98912F2F9C95}
9 | Library
10 | Properties
11 | QuartzNServiceBusSample.Host
12 | QuartzNServiceBusSample.Host
13 | v4.0
14 | 512
15 |
16 |
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | pdbonly
27 | true
28 | bin\Release\
29 | TRACE
30 | prompt
31 | 4
32 |
33 |
34 |
35 | ..\packages\log4net.1.2.10\lib\2.0\log4net.dll
36 |
37 |
38 | ..\packages\NServiceBus.3.2.6\lib\net40\NServiceBus.dll
39 |
40 |
41 | ..\packages\NServiceBus.3.2.6\lib\net40\NServiceBus.Core.dll
42 |
43 |
44 | .exe
45 | ..\packages\NServiceBus.Host.3.2.6\lib\net40\NServiceBus.Host.exe
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 | {819A50C9-346E-4C2C-BB57-6F10FC60D482}
67 | QuartzNServiceBusSample.Messages
68 |
69 |
70 |
71 |
78 |
79 | Program
80 | $(ProjectDir)$(OutputPath)NServiceBus.Host.exe
81 |
82 |
--------------------------------------------------------------------------------
/QuartzNServiceBusSample/QuartzNServiceBusSample.Scheduler.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {92534EFD-D917-43AA-ABB3-0229B0575FEC}
9 | Library
10 | Properties
11 | QuartzNServiceBusSample
12 | QuartzNServiceBusSample
13 | v4.0
14 | 512
15 |
16 |
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | pdbonly
27 | true
28 | bin\Release\
29 | TRACE
30 | prompt
31 | 4
32 |
33 |
34 |
35 | ..\packages\Quartz.2.0.1\lib\net40\C5.dll
36 |
37 |
38 | False
39 | ..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll
40 |
41 |
42 | ..\packages\log4net.1.2.10\lib\2.0\log4net.dll
43 |
44 |
45 | ..\packages\NServiceBus.3.2.6\lib\net40\NServiceBus.dll
46 |
47 |
48 | ..\packages\NServiceBus.3.2.6\lib\net40\NServiceBus.Core.dll
49 |
50 |
51 | .exe
52 | ..\packages\NServiceBus.Host.3.2.6\lib\net40\NServiceBus.Host.exe
53 |
54 |
55 | False
56 | ..\packages\Quartz.2.0.1\lib\net40\Quartz.dll
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 | Designer
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 | {819A50C9-346E-4C2C-BB57-6F10FC60D482}
87 | QuartzNServiceBusSample.Messages
88 |
89 |
90 |
91 |
98 |
99 | Program
100 | $(ProjectDir)$(OutputPath)NServiceBus.Host.exe
101 |
102 |
--------------------------------------------------------------------------------
/QuartzNServiceBusSample/QuartzTables.sql:
--------------------------------------------------------------------------------
1 | --# thanks to George Papastamatopoulos for submitting this ... and Marko Lahma for
2 | --# updating it.
3 |
4 | USE QuartzNServiceBusSample
5 | GO
6 | IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[FK_QRTZ_TRIGGERS_QRTZ_JOB_DETAILS]') AND OBJECTPROPERTY(id, N'ISFOREIGNKEY') = 1)
7 | ALTER TABLE [dbo].[QRTZ_TRIGGERS] DROP CONSTRAINT FK_QRTZ_TRIGGERS_QRTZ_JOB_DETAILS
8 | GO
9 |
10 | IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[FK_QRTZ_CRON_TRIGGERS_QRTZ_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISFOREIGNKEY') = 1)
11 | ALTER TABLE [dbo].[QRTZ_CRON_TRIGGERS] DROP CONSTRAINT FK_QRTZ_CRON_TRIGGERS_QRTZ_TRIGGERS
12 | GO
13 |
14 | IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[FK_QRTZ_SIMPLE_TRIGGERS_QRTZ_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISFOREIGNKEY') = 1)
15 | ALTER TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] DROP CONSTRAINT FK_QRTZ_SIMPLE_TRIGGERS_QRTZ_TRIGGERS
16 | GO
17 |
18 | IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[FK_QRTZ_SIMPROP_TRIGGERS_QRTZ_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISFOREIGNKEY') = 1)
19 | ALTER TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] DROP CONSTRAINT FK_QRTZ_SIMPROP_TRIGGERS_QRTZ_TRIGGERS
20 | GO
21 |
22 | IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_QRTZ_JOB_LISTENERS_QRTZ_JOB_DETAILS]') AND parent_object_id = OBJECT_ID(N'[dbo].[QRTZ_JOB_LISTENERS]'))
23 | ALTER TABLE [dbo].[QRTZ_JOB_LISTENERS] DROP CONSTRAINT [FK_QRTZ_JOB_LISTENERS_QRTZ_JOB_DETAILS]
24 |
25 | IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_QRTZ_TRIGGER_LISTENERS_QRTZ_TRIGGERS]') AND parent_object_id = OBJECT_ID(N'[dbo].[QRTZ_TRIGGER_LISTENERS]'))
26 | ALTER TABLE [dbo].[QRTZ_TRIGGER_LISTENERS] DROP CONSTRAINT [FK_QRTZ_TRIGGER_LISTENERS_QRTZ_TRIGGERS]
27 |
28 |
29 | IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_CALENDARS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
30 | DROP TABLE [dbo].[QRTZ_CALENDARS]
31 | GO
32 |
33 | IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_CRON_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
34 | DROP TABLE [dbo].[QRTZ_CRON_TRIGGERS]
35 | GO
36 |
37 | IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_BLOB_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
38 | DROP TABLE [dbo].[QRTZ_BLOB_TRIGGERS]
39 | GO
40 |
41 | IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_FIRED_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
42 | DROP TABLE [dbo].[QRTZ_FIRED_TRIGGERS]
43 | GO
44 |
45 | IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_PAUSED_TRIGGER_GRPS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
46 | DROP TABLE [dbo].[QRTZ_PAUSED_TRIGGER_GRPS]
47 | GO
48 |
49 | IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[QRTZ_JOB_LISTENERS]') AND type in (N'U'))
50 | DROP TABLE [dbo].[QRTZ_JOB_LISTENERS]
51 |
52 | IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_SCHEDULER_STATE]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
53 | DROP TABLE [dbo].[QRTZ_SCHEDULER_STATE]
54 | GO
55 |
56 | IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_LOCKS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
57 | DROP TABLE [dbo].[QRTZ_LOCKS]
58 | GO
59 | IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[QRTZ_TRIGGER_LISTENERS]') AND type in (N'U'))
60 | DROP TABLE [dbo].[QRTZ_TRIGGER_LISTENERS]
61 |
62 |
63 | IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_JOB_DETAILS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
64 | DROP TABLE [dbo].[QRTZ_JOB_DETAILS]
65 | GO
66 |
67 | IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_SIMPLE_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
68 | DROP TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS]
69 | GO
70 |
71 | IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_SIMPROP_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
72 | DROP TABLE [dbo].QRTZ_SIMPROP_TRIGGERS
73 | GO
74 |
75 | IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
76 | DROP TABLE [dbo].[QRTZ_TRIGGERS]
77 | GO
78 |
79 | CREATE TABLE [dbo].[QRTZ_CALENDARS] (
80 | [SCHED_NAME] [NVARCHAR] (100) NOT NULL ,
81 | [CALENDAR_NAME] [NVARCHAR] (200) NOT NULL ,
82 | [CALENDAR] [IMAGE] NOT NULL
83 | ) ON [PRIMARY]
84 | GO
85 |
86 | CREATE TABLE [dbo].[QRTZ_CRON_TRIGGERS] (
87 | [SCHED_NAME] [NVARCHAR] (100) NOT NULL ,
88 | [TRIGGER_NAME] [NVARCHAR] (150) NOT NULL ,
89 | [TRIGGER_GROUP] [NVARCHAR] (150) NOT NULL ,
90 | [CRON_EXPRESSION] [NVARCHAR] (120) NOT NULL ,
91 | [TIME_ZONE_ID] [NVARCHAR] (80)
92 | ) ON [PRIMARY]
93 | GO
94 |
95 | CREATE TABLE [dbo].[QRTZ_FIRED_TRIGGERS] (
96 | [SCHED_NAME] [NVARCHAR] (100) NOT NULL ,
97 | [ENTRY_ID] [NVARCHAR] (95) NOT NULL ,
98 | [TRIGGER_NAME] [NVARCHAR] (150) NOT NULL ,
99 | [TRIGGER_GROUP] [NVARCHAR] (150) NOT NULL ,
100 | [INSTANCE_NAME] [NVARCHAR] (200) NOT NULL ,
101 | [FIRED_TIME] [BIGINT] NOT NULL ,
102 | [PRIORITY] [INTEGER] NOT NULL ,
103 | [STATE] [NVARCHAR] (16) NOT NULL,
104 | [JOB_NAME] [NVARCHAR] (150) NULL ,
105 | [JOB_GROUP] [NVARCHAR] (150) NULL ,
106 | [IS_NONCONCURRENT] BIT NULL ,
107 | [REQUESTS_RECOVERY] BIT NULL
108 | ) ON [PRIMARY]
109 | GO
110 |
111 | CREATE TABLE [dbo].[QRTZ_PAUSED_TRIGGER_GRPS] (
112 | [SCHED_NAME] [NVARCHAR] (100) NOT NULL ,
113 | [TRIGGER_GROUP] [NVARCHAR] (150) NOT NULL
114 | ) ON [PRIMARY]
115 | GO
116 |
117 | CREATE TABLE [dbo].[QRTZ_SCHEDULER_STATE] (
118 | [SCHED_NAME] [NVARCHAR] (100) NOT NULL ,
119 | [INSTANCE_NAME] [NVARCHAR] (200) NOT NULL ,
120 | [LAST_CHECKIN_TIME] [BIGINT] NOT NULL ,
121 | [CHECKIN_INTERVAL] [BIGINT] NOT NULL
122 | ) ON [PRIMARY]
123 | GO
124 |
125 | CREATE TABLE [dbo].[QRTZ_LOCKS] (
126 | [SCHED_NAME] [NVARCHAR] (100) NOT NULL ,
127 | [LOCK_NAME] [NVARCHAR] (40) NOT NULL
128 | ) ON [PRIMARY]
129 | GO
130 |
131 | CREATE TABLE [dbo].[QRTZ_JOB_DETAILS] (
132 | [SCHED_NAME] [NVARCHAR] (100) NOT NULL ,
133 | [JOB_NAME] [NVARCHAR] (150) NOT NULL ,
134 | [JOB_GROUP] [NVARCHAR] (150) NOT NULL ,
135 | [DESCRIPTION] [NVARCHAR] (250) NULL ,
136 | [JOB_CLASS_NAME] [NVARCHAR] (250) NOT NULL ,
137 | [IS_DURABLE] BIT NOT NULL ,
138 | [IS_NONCONCURRENT] BIT NOT NULL ,
139 | [IS_UPDATE_DATA] BIT NOT NULL ,
140 | [REQUESTS_RECOVERY] BIT NOT NULL ,
141 | [JOB_DATA] [IMAGE] NULL
142 | ) ON [PRIMARY]
143 | GO
144 |
145 | CREATE TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] (
146 | [SCHED_NAME] [NVARCHAR] (100) NOT NULL ,
147 | [TRIGGER_NAME] [NVARCHAR] (150) NOT NULL ,
148 | [TRIGGER_GROUP] [NVARCHAR] (150) NOT NULL ,
149 | [REPEAT_COUNT] [INTEGER] NOT NULL ,
150 | [REPEAT_INTERVAL] [BIGINT] NOT NULL ,
151 | [TIMES_TRIGGERED] [INTEGER] NOT NULL
152 | ) ON [PRIMARY]
153 | GO
154 |
155 | CREATE TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] (
156 | [SCHED_NAME] [NVARCHAR] (100) NOT NULL ,
157 | [TRIGGER_NAME] [NVARCHAR] (150) NOT NULL ,
158 | [TRIGGER_GROUP] [NVARCHAR] (150) NOT NULL ,
159 | [STR_PROP_1] [NVARCHAR] (512) NULL,
160 | [STR_PROP_2] [NVARCHAR] (512) NULL,
161 | [STR_PROP_3] [NVARCHAR] (512) NULL,
162 | [INT_PROP_1] [INT] NULL,
163 | [INT_PROP_2] [INT] NULL,
164 | [LONG_PROP_1] [BIGINT] NULL,
165 | [LONG_PROP_2] [BIGINT] NULL,
166 | [DEC_PROP_1] [NUMERIC] (13,4) NULL,
167 | [DEC_PROP_2] [NUMERIC] (13,4) NULL,
168 | [BOOL_PROP_1] BIT NULL,
169 | [BOOL_PROP_2] BIT NULL,
170 | ) ON [PRIMARY]
171 | GO
172 |
173 | CREATE TABLE [dbo].[QRTZ_BLOB_TRIGGERS] (
174 | [SCHED_NAME] [NVARCHAR] (100) NOT NULL ,
175 | [TRIGGER_NAME] [NVARCHAR] (150) NOT NULL ,
176 | [TRIGGER_GROUP] [NVARCHAR] (150) NOT NULL ,
177 | [BLOB_DATA] [IMAGE] NULL
178 | ) ON [PRIMARY]
179 | GO
180 |
181 | CREATE TABLE [dbo].[QRTZ_TRIGGERS] (
182 | [SCHED_NAME] [NVARCHAR] (100) NOT NULL ,
183 | [TRIGGER_NAME] [NVARCHAR] (150) NOT NULL ,
184 | [TRIGGER_GROUP] [NVARCHAR] (150) NOT NULL ,
185 | [JOB_NAME] [NVARCHAR] (150) NOT NULL ,
186 | [JOB_GROUP] [NVARCHAR] (150) NOT NULL ,
187 | [DESCRIPTION] [NVARCHAR] (250) NULL ,
188 | [NEXT_FIRE_TIME] [BIGINT] NULL ,
189 | [PREV_FIRE_TIME] [BIGINT] NULL ,
190 | [PRIORITY] [INTEGER] NULL ,
191 | [TRIGGER_STATE] [NVARCHAR] (16) NOT NULL ,
192 | [TRIGGER_TYPE] [NVARCHAR] (8) NOT NULL ,
193 | [START_TIME] [BIGINT] NOT NULL ,
194 | [END_TIME] [BIGINT] NULL ,
195 | [CALENDAR_NAME] [NVARCHAR] (200) NULL ,
196 | [MISFIRE_INSTR] [INTEGER] NULL ,
197 | [JOB_DATA] [IMAGE] NULL
198 | ) ON [PRIMARY]
199 | GO
200 |
201 | ALTER TABLE [dbo].[QRTZ_CALENDARS] WITH NOCHECK ADD
202 | CONSTRAINT [PK_QRTZ_CALENDARS] PRIMARY KEY CLUSTERED
203 | (
204 | [SCHED_NAME],
205 | [CALENDAR_NAME]
206 | ) ON [PRIMARY]
207 | GO
208 |
209 | ALTER TABLE [dbo].[QRTZ_CRON_TRIGGERS] WITH NOCHECK ADD
210 | CONSTRAINT [PK_QRTZ_CRON_TRIGGERS] PRIMARY KEY CLUSTERED
211 | (
212 | [SCHED_NAME],
213 | [TRIGGER_NAME],
214 | [TRIGGER_GROUP]
215 | ) ON [PRIMARY]
216 | GO
217 |
218 | ALTER TABLE [dbo].[QRTZ_FIRED_TRIGGERS] WITH NOCHECK ADD
219 | CONSTRAINT [PK_QRTZ_FIRED_TRIGGERS] PRIMARY KEY CLUSTERED
220 | (
221 | [SCHED_NAME],
222 | [ENTRY_ID]
223 | ) ON [PRIMARY]
224 | GO
225 |
226 | ALTER TABLE [dbo].[QRTZ_PAUSED_TRIGGER_GRPS] WITH NOCHECK ADD
227 | CONSTRAINT [PK_QRTZ_PAUSED_TRIGGER_GRPS] PRIMARY KEY CLUSTERED
228 | (
229 | [SCHED_NAME],
230 | [TRIGGER_GROUP]
231 | ) ON [PRIMARY]
232 | GO
233 |
234 | ALTER TABLE [dbo].[QRTZ_SCHEDULER_STATE] WITH NOCHECK ADD
235 | CONSTRAINT [PK_QRTZ_SCHEDULER_STATE] PRIMARY KEY CLUSTERED
236 | (
237 | [SCHED_NAME],
238 | [INSTANCE_NAME]
239 | ) ON [PRIMARY]
240 | GO
241 |
242 | ALTER TABLE [dbo].[QRTZ_LOCKS] WITH NOCHECK ADD
243 | CONSTRAINT [PK_QRTZ_LOCKS] PRIMARY KEY CLUSTERED
244 | (
245 | [SCHED_NAME],
246 | [LOCK_NAME]
247 | ) ON [PRIMARY]
248 | GO
249 |
250 | ALTER TABLE [dbo].[QRTZ_JOB_DETAILS] WITH NOCHECK ADD
251 | CONSTRAINT [PK_QRTZ_JOB_DETAILS] PRIMARY KEY CLUSTERED
252 | (
253 | [SCHED_NAME],
254 | [JOB_NAME],
255 | [JOB_GROUP]
256 | ) ON [PRIMARY]
257 | GO
258 |
259 | ALTER TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] WITH NOCHECK ADD
260 | CONSTRAINT [PK_QRTZ_SIMPLE_TRIGGERS] PRIMARY KEY CLUSTERED
261 | (
262 | [SCHED_NAME],
263 | [TRIGGER_NAME],
264 | [TRIGGER_GROUP]
265 | ) ON [PRIMARY]
266 | GO
267 |
268 | ALTER TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] WITH NOCHECK ADD
269 | CONSTRAINT [PK_QRTZ_SIMPROP_TRIGGERS] PRIMARY KEY CLUSTERED
270 | (
271 | [SCHED_NAME],
272 | [TRIGGER_NAME],
273 | [TRIGGER_GROUP]
274 | ) ON [PRIMARY]
275 | GO
276 |
277 | ALTER TABLE [dbo].[QRTZ_TRIGGERS] WITH NOCHECK ADD
278 | CONSTRAINT [PK_QRTZ_TRIGGERS] PRIMARY KEY CLUSTERED
279 | (
280 | [SCHED_NAME],
281 | [TRIGGER_NAME],
282 | [TRIGGER_GROUP]
283 | ) ON [PRIMARY]
284 | GO
285 |
286 | ALTER TABLE [dbo].[QRTZ_CRON_TRIGGERS] ADD
287 | CONSTRAINT [FK_QRTZ_CRON_TRIGGERS_QRTZ_TRIGGERS] FOREIGN KEY
288 | (
289 | [SCHED_NAME],
290 | [TRIGGER_NAME],
291 | [TRIGGER_GROUP]
292 | ) REFERENCES [dbo].[QRTZ_TRIGGERS] (
293 | [SCHED_NAME],
294 | [TRIGGER_NAME],
295 | [TRIGGER_GROUP]
296 | ) ON DELETE CASCADE
297 | GO
298 |
299 | ALTER TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] ADD
300 | CONSTRAINT [FK_QRTZ_SIMPLE_TRIGGERS_QRTZ_TRIGGERS] FOREIGN KEY
301 | (
302 | [SCHED_NAME],
303 | [TRIGGER_NAME],
304 | [TRIGGER_GROUP]
305 | ) REFERENCES [dbo].[QRTZ_TRIGGERS] (
306 | [SCHED_NAME],
307 | [TRIGGER_NAME],
308 | [TRIGGER_GROUP]
309 | ) ON DELETE CASCADE
310 | GO
311 |
312 | ALTER TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] ADD
313 | CONSTRAINT [FK_QRTZ_SIMPROP_TRIGGERS_QRTZ_TRIGGERS] FOREIGN KEY
314 | (
315 | [SCHED_NAME],
316 | [TRIGGER_NAME],
317 | [TRIGGER_GROUP]
318 | ) REFERENCES [dbo].[QRTZ_TRIGGERS] (
319 | [SCHED_NAME],
320 | [TRIGGER_NAME],
321 | [TRIGGER_GROUP]
322 | ) ON DELETE CASCADE
323 | GO
324 |
325 | ALTER TABLE [dbo].[QRTZ_TRIGGERS] ADD
326 | CONSTRAINT [FK_QRTZ_TRIGGERS_QRTZ_JOB_DETAILS] FOREIGN KEY
327 | (
328 | [SCHED_NAME],
329 | [JOB_NAME],
330 | [JOB_GROUP]
331 | ) REFERENCES [dbo].[QRTZ_JOB_DETAILS] (
332 | [SCHED_NAME],
333 | [JOB_NAME],
334 | [JOB_GROUP]
335 | )
336 | GO
337 |
338 | CREATE INDEX IDX_QRTZ_T_J ON QRTZ_TRIGGERS(SCHED_NAME,JOB_NAME,JOB_GROUP)
339 | CREATE INDEX IDX_QRTZ_T_JG ON QRTZ_TRIGGERS(SCHED_NAME,JOB_GROUP)
340 | CREATE INDEX IDX_QRTZ_T_C ON QRTZ_TRIGGERS(SCHED_NAME,CALENDAR_NAME)
341 | CREATE INDEX IDX_QRTZ_T_G ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_GROUP)
342 | CREATE INDEX IDX_QRTZ_T_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_STATE)
343 | CREATE INDEX IDX_QRTZ_T_N_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_STATE)
344 | CREATE INDEX IDX_QRTZ_T_N_G_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_GROUP,TRIGGER_STATE)
345 | CREATE INDEX IDX_QRTZ_T_NEXT_FIRE_TIME ON QRTZ_TRIGGERS(SCHED_NAME,NEXT_FIRE_TIME)
346 | CREATE INDEX IDX_QRTZ_T_NFT_ST ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_STATE,NEXT_FIRE_TIME)
347 | CREATE INDEX IDX_QRTZ_T_NFT_MISFIRE ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME)
348 | CREATE INDEX IDX_QRTZ_T_NFT_ST_MISFIRE ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_STATE)
349 | CREATE INDEX IDX_QRTZ_T_NFT_ST_MISFIRE_GRP ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_GROUP,TRIGGER_STATE)
350 |
351 | CREATE INDEX IDX_QRTZ_FT_TRIG_INST_NAME ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,INSTANCE_NAME)
352 | CREATE INDEX IDX_QRTZ_FT_INST_JOB_REQ_RCVRY ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,INSTANCE_NAME,REQUESTS_RECOVERY)
353 | CREATE INDEX IDX_QRTZ_FT_J_G ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,JOB_NAME,JOB_GROUP)
354 | CREATE INDEX IDX_QRTZ_FT_JG ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,JOB_GROUP)
355 | CREATE INDEX IDX_QRTZ_FT_T_G ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
356 | CREATE INDEX IDX_QRTZ_FT_TG ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,TRIGGER_GROUP)
357 | GO
--------------------------------------------------------------------------------