Java client for penfold.
- JVM 8+
<dependency>
<groupId>org.huwtl</groupId>
<artifactId>penfold-client</artifactId>
<version>${VERSION}</version>
</dependency>
Use this if you wish to query tasks.
final TaskQueryService service = new TaskQueryServiceBuilder()
.forServer("http://localhost")
.withCredentials("user", "pass")
.build();
Use this if you wish to create or update tasks.
final TaskStoreService service = new TaskStoreServiceBuilder()
.forServer("http://localhost")
.withCredentials("user", "pass")
.build();
Use this if you wish to consume from a queue of tasks.
new TaskConsumerBuilder()
.fromServer("http://localhost")
.withCredentials("user", "pass")
.fromQueue("testqueue")
.delayBetweenEachRetryOf(15, TimeUnit.MINUTES)
.consumeWith(new ConsumerFunction() {
@Override public Result execute(final Task task) {
// your implementation here
}})
.build()
.start();