Skip to content

Ingestions

An ingestion takes data from a source (an SFTP directory, a queue, an HTTP endpoint, a database table, a polled API), splits it into records, and turns each record into a dispatch job. The model is in ingestion and the how-to in your first ingestion. The Java SDK manages ingestions through client.ingestions() and client.ingestionSets().

The runtime operations (/api/ingestion-runtime/v1/*) belong to the ingestion runtime’s own client and are not in this SDK.

An ingestion needs a required application (the code of an INTEGRATION application) and a required client (an id or an identifier slug).

var created = client.ingestions().create(new CreateIngestionRequest()
.application("orders").client("acme").code("feed").name("Feed")
.source(new Source.Sftp("sftp.acme.test", 22, "/out", "feed",
new SecretRef("acme-sftp-key"), null, "*.csv", Duration.ofMinutes(5)))
.split(new Split.Csv(true))
.target(IngestionDefinitions.target("orders:feed:row", "https://api.example.com/rows",
"orders-pool", Mode.NEXT_ON_ERROR, 100)));

IngestionDefinitions gives the source and split real types, because the OpenAPI document leaves them as open objects tagged by kind.

Source Members
Source.Http HttpAuth auth (FlowCatalystToken, Basic, Bearer), optional RateLimit. Data is posted to an endpoint the runtime exposes.
Source.Sftp host, port, directory, username, credential, knownHosts, acceptAnyHostKey, include, every
Source.S3 region, bucket, prefix, every, credential
Source.Sqs region, queue, credential. The queue by name, not URL.
Source.RabbitMq uri, queue, username, password
Source.DatabasePoll jdbcUrl, username, password, table, track, maxRows, every, with a Watermark or Status tracker
Source.ApiPoll url, method, headers, body, auth, results, cursor, every, idleDelay
Source.Custom(type, settings) A kind a runtime extension supplies, and camel-route.
Split Meaning
Split.None The whole payload is one record.
Split.Csv(header) One record per line; header drops the first.
Split.Json(arrayPath) One record per element of the array at $ or $.field.field.
Split.Xml(element) One record per occurrence of element.

A secret is a SecretRef name, never a value. The runtime resolves the name against the ingestion’s client. IngestionDefinitions.target(code, targetUrl, pool, mode, batchSize) builds the target; set connection or serviceAccount on the result if you need one (not both). IngestionDefinitions.sourceOf(wire) and splitOf(wire) turn a response’s open objects back into the typed form.

var page = client.ingestions().list(IngestionsResource.ListFilters.page(null, 50));
var next = client.ingestions().list(IngestionsResource.ListFilters.page(page.getNextCursor(), 50));
var ingestion = client.ingestions().get(id);
String yaml = client.ingestions().getDefinition(id); // the file form that `fcdev ingest apply` reads
client.ingestions().pause(id);
client.ingestions().resume(id);

Lists are cursor paged: pass the answer’s nextCursor as after. ListFilters also filters by application, client, free text q, status and kind.

update(id, request) takes the live version you read as expectedVersion; a stale version is a 409. A code that is already in use answers 409 INGESTION_CODE_EXISTS, and an ingestion a set owns answers 409 INGESTION_SET_OWNED. Versions: listVersions(id), saveVersion(id, request), makeVersionLive(id, version). History: listHistory(id, limit, offset). delete(id) removes it.

Connection tests: testConnection(request) starts one and getTest(id) reads it; listSourceKinds() lists the kinds the runtimes support.

Without the promote permission, create, update and saveVersion save the definition as a draft; they do not fail. The answer’s getSave().getOutcome() is DRAFT and getSave().getAwaitingPromote() is true until someone who holds promote calls makeVersionLive.

A definition an existing version already says is not saved again. The outcome says which case it was: SAVED, MADE_LIVE, DRAFT, DRAFT_EXISTS or UNCHANGED. Versions carry draft and a digest.

getWarnings() names what will not run as meant. A common one is an SFTP source with neither knownHosts nor acceptAnyHostKey: without a host key the runtime refuses to start the source. acceptAnyHostKey connects without checking who the server is, so whoever answers receives the credential, and turning it on needs the bind-secrets permission.

A notice is a failure the platform refused (category rejected). The ingestion counts the open ones (getNotices(), getLatestNotice()).

var open = client.ingestions().listFailures(id, IngestionsResource.FailureFilters.openNotices());
client.ingestions().dismissFailure(id, open.getFailures().getFirst().getId()); // stays listed
var secrets = client.ingestions().listSecrets(id); // bound names and each runtime's last fetch
  • FailureFilters has after, limit, category (payload or rejected) and undismissed. openNotices() is rejected and undismissed. Dismissing keeps the failure in the list.
  • listSecrets returns the names the live definition binds, whether each is bound, and per runtime the last fetch (fetchCount, lastFetchedAt). Never a value.

A set is a named group of ingestions applied together from definition files. A set owns its ingestions: they are read-only until the set is released, and an ingestion the set no longer lists is deleted by the next apply. Listing and applying need access to every client and application.

client.ingestionSets().list();
client.ingestionSets().apply(name, request, true); // true: a dry run, reports the changes, writes nothing
client.ingestionSets().apply(name, request, false);
client.ingestionSets().listApplies(name);
client.ingestionSets().getApply(name, applyId);
client.ingestionSets().reapply(name, applyId, false); // an archived apply's items again, as a new apply
client.ingestionSets().release(name); // ends the set's ownership; nothing else changes

Passing null as dryRun leaves the parameter off.

See definitions and sets.

Failures are FlowCatalystExceptions with an SdkError variant; the platform’s code is on Conflict for the 409 cases. See Errors.