Jobbr is a .NET job server. It is designed to reduce artifical complexity when a job server is needed in a project. Jobbr tries to get out of your way as much as possible so that you can focus on business logic. Job implementations have no dependency to Jobbr which makes it easy to integrate Jobbr in any .NET project.
- Isolation of Jobs on process-level
- REST API to manage and trigger Jobs and watch the execution state
- Provides a typed client to consume the REST API
- Persists created files from running jobs in an artefact store.
- Supports CRON expressions for recurring triggers
- Embeddable in your own C# application (JobServer and Runner)
- Easily testable
- IOC for your jobs
- Extendable (jobstorage providers, artefact storage providers, execution etc)
- Progress tracking via stdout (
Console.WriteLine()
)
The best way to get started is to check out the demo repo to see a running example of Jobbr.
Good news! All your C#-Code is compatible with jobbr as long as the CLR-type can be instantiated and has at least a public Run()
- Method.
public class SampleJob
{
public void Run()
{
const int iterations = 15;
for (var i = 0; i < iterations; i++)
{
Thread.Sleep(500);
Console.WriteLine("##jobbr[progress percent='{0:0.00}']", (double)(i + 1) / iterations * 100); // optional: report progress
}
}
}
To define jobs use the AddJobs
extension method:
jobbrBuilder.AddJobs(repo =>
{
// define one job with two triggers
repo.Define("SampleJob", "Quickstart.SampleJob")
.WithTrigger(DateTime.UtcNow.AddHours(2)) /* run once in two hours */
.WithTrigger("* * * * *"); /* run every minute */
});
If you need to add triggers at runtime head over to the REST API component which also includes a typed client. The REST API is optional and has to be plugged in if needed.
There are two different storages:
Storage
: stores jobs, triggers and jobrunsArtefactStorage
: stores files created by running jobs
By default Jobbr runs in memory, thus all data is lost when Jobbr is restarted. To keep the data configure one of the storage providers:
- MsSql Storage Provider to store the data in MS SQL Server
- RavenDb Storage Provider to store the data in RavenDB
- Filesystem Storage Provider to store the data in a folder
- RavenFS Storage Provider to store the data in RavenDB
This software is licenced under GPLv3. See LICENSE, please see the related licences of 3rd party libraries below.
Jobbr Server is based on following great open source projects:
This application was built by the following awesome developers: