Client SDK Overview
com.uber.cadence.activity
APIs to implement activity: accessing activity info, or sending heartbeat.
com.uber.cadence.client
Client to the Cadence service used to start and query workflows by external processes
com.uber.cadence.workflow
APIs to implement workflows.
com.uber.cadence.worker
APIs to configure and start workers.
com.uber.cadence.testing
APIs to write unit tests for workflows.
Cadence Java Samples
com.uber.cadence.samples.hello
Samples of how to use the basic feature: activity, local activity, ChildWorkflow, Query, etc. This is the most important package you need to start with.
com.uber.cadence.samples.bookingsaga
An end-to-end example to write workflow using SAGA APIs.
com.uber.cadence.samples.fileprocessing
An end-to-end example to write workflows to download a file, zips it, and uploads it to a destination.
An important requirement for such a workflow is that while a first activity can run on any host, the second and third must run on the same host as the first one. This is achieved through use of a host specific task list. The first activity returns the name of the host specific task list and all other activities are dispatched using the stub that is configured with it. This assumes that FileProcessingWorker has a worker running on the same task list.
Differences between Java and Golang Clients
While many features are already supported in the Cadence Golang client, some features are missing in the Java client. The Cadence development team aims for feature parity between the two clients, with new features typically being implemented in cadence-go-client first.
Feature Comparison
Feature | Go Client | Java Client | Issue |
---|---|---|---|
Up to Date Samples | Supported | No | Link |
Customer provided context propagator | Supported | No | |
Poller autoscale | Supported | No | |
Auto heartbeat1 | Supported | No | |
Jitter start | Supported | No | |
Sessions (sticky activity workers)2 | Supported | No | |
List all queries supported for a given workflow | Supported | No |