Client API
Majordodo main client API is HTTP/JSON based.
Operations are:
- submit a single task
- submit multiple tasks
- begin a transaction
- commit a transaction
- rollback a transaction
- get tasks status
- create a CodePool
- delete a CodePool
- get CodePool status
For Java client it's better to use the official Java Client API, which is based on Apache Commons HttpComponents and Jackson Mapper (for JSON). It provides connection pooling and it is tested and maintained by the dev team.
Transactions
Submission of tasks can be done inside the context of a transaction.
Only when the transaction gets committed then actually the tasks are scheduled for execution. Upon rollback tasks are discarded automatically.
Given the stateless nature of Http (even when using persistent/keep-alive connections) abandoned (uncommitted) transaction are automatically rolled back after a configurable period of inactivity.
Slots
If a task is submitted within a slot then response of the submitTask (and submitTasks) request will not return a new taskid if the slot is already busy. When running inside a transaction the slot is locked immediately, and it's freed automatically on rollbacks.
Maven coordinates
Main dependency for clients is majordodo-client
<dependency>
<groupId>majordodo</groupId>
<artifactId>majordodo-client</artifactId>
<version>your-majordodo-version</version>
</dependency>
If you use dynamic code deployment you have to implement TaskExecutor an so you will need the majordodo-worker dependency
<dependency>
<groupId>majordodo</groupId>
<artifactId>majordodo-worker</artifactId>
<version>your-majordodo-version</version>
</dependency>
Updated less than a minute ago