Skip to main content

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

FeatureGo ClientJava ClientIssue
Up to Date SamplesSupportedNoLink
Customer provided context propagatorSupportedNo
Poller autoscaleSupportedNo
Auto heartbeat1SupportedNo
Jitter startSupportedNo
Sessions (sticky activity workers)2SupportedNo
List all queries supported for a given workflowSupportedNo

Footnotes

  1. heartbeating in java is simple to implement and might be better for end user to determine which type of heart beating is better for the use case rather than add a generic auto-heartbeat mechanism to the client.

  2. feature needs more traction in order to prioritize