Do you have some jobs that can only be run on certain servers (e.g. jobs tied to a specific OS like Linux, Max and Windows)? JobRunr has you covered with Server Tags!
BackgroundJobServer can have multiple server tags and a job can specify only one server tag via the Job annotation. If the server tag of the job matches any of the server tags of the server, the server is eligible to run the job.
Jobis by default tagged with the
DEFAULTtag - this makes sure that if you do not specify a tag on the
Job, it gets executed anyway.
Using server tags is as easy as using Queues, again thanks to the
Job annotation. Just add it to your service method and specify on which server your background job should run.
Configuration is easy, both in the fluent api and using Spring configuration:
Using the fluent API, pass all the server tags as Strings (or string constants) to the
For the Spring configuration, it is exactly the same.