Released docs. You are viewing the documentation published with v0.48.0. Development docs are available at Latest.
An Adapter pack and an Adapter project describe routes in platform YAML. The route content follows the structure of Apache Camel’s YAML DSL, so a Camel reader recognises it. The engine is a bounded port of Camel’s route model, not a Camel runtime: there is no JVM, no Camel YAML file and no Camel library. Where the Adapter differs from Camel, the difference exists to keep a route bounded, and this page states it. Camel 4.23.0 is the reference for semantics.
This page covers the route language. Configure an Adapter project covers the artifacts that hold routes, the facade contract and the exchange contract between a route and its profile.
Exchange and message
Section titled “Exchange and message”An exchange follows Camel’s Exchange and Message.
It has an exchangeId, a pattern (always InOut), one message (headers and body), exchange properties and an exception slot.
Headers are a bounded, case-insensitive map.
The body is a size-bounded JSON value once unmarshalled.
The http and graphql components marshal and unmarshal JSON themselves, so a route has no marshal or unmarshal step.
Split and loop metadata lives in exchange properties: CamelSplitIndex, CamelSplitSize, CamelSplitComplete, CamelSplitResult, CamelLoopIndex and CamelLoopSize.
These names have no header aliases, and authored steps or aggregation results cannot overwrite them.
What enters the exchange is declared.
The rest consumer places only the bound operation’s validated inputs on it, under the closed names listed in the exchange contract.
The http component copies upstream response headers onto it only where the endpoint declares them, and sends exchange headers upstream only where the endpoint’s requestHeaders allowlist names them.
Credentials, base URLs and secrets never enter the exchange, and no expression or header can carry them out.
Routes
Section titled “Routes”A step is an externally tagged union keyed by the Camel EIP name, as Camel’s YAML DSL writes it. This route fetches a tracked entity and then either empties the body or shapes the record:
routes: - id: fetch-tracked-entity from: uri: "direct:fetch-tracked-entity" steps: - to: uri: "http:tracker" parameters: httpMethod: GET path: "/api/tracker/trackedEntities/{{id}}" pathParameters: id: header: recordId query: program: constant: "{{program}}" fields: constant: "*" - choice: when: - jsonpath: "$.inactive" steps: - setBody: constant: null otherwise: steps: - setBody: rhai: file: scripts/tracked-entity.rhai entrypoint: toRecordThe route language differs from Camel in these bounded ways:
- One route has one
from. fromURIs aredirect:only. Therestconsumer dispatches to them.- The route call graph through
direct:is acyclic and its depth is bounded. - Every
loopandsplitdeclares its maximum. - Inline code is refused, so
rhaialways names a digest-pinned file.
Route templates
Section titled “Route templates”A pack is a catalogue of route templates, the role Kamelets play for Camel.
A template declares typed parameters (name, type, required, defaultValue, description) and a route body that references them as {{name}} placeholders.
{{?name}} marks an optional parameter.
Camel parameters are untyped strings; Adapter parameters are typed and checked.
A project instantiates a template with Camel’s templatedRoute shape: routeTemplateRef, routeId and parameters.
Placeholders resolve at instantiation, during adapterctl check and at startup, never per request.
A template parameter carries only authored values (field mappings, programme identifiers, code-map names), never environment values.
Environment values reach the engine only through endpoint ids that the runtime config resolves.
A template omits from.
The instantiated route’s from is direct:<routeId>.
A pack may also carry ordinary internal routes for shared sub-flows, which are the direct: targets of to and enrich.
A deployment project writes no routes: it instantiates pack templates with templatedRoutes and binds them, and the project format has no member for a route body.
Expression languages
Section titled “Expression languages”Expressions are externally tagged by language, as in Camel (setBody: { jsonpath: "$.instances" }).
constant,headerandexchangePropertyare Camel’s built-in languages, written inline.jsonpathis RFC 9535 JSONPath, written inline. It follows Camel’scamel-jsonpathlanguage but uses the IETF standard rather than the Jayway dialect.rhaiis a digest-pinned script file and entrypoint. It replaces Camel’s Simple language, Groovy, JavaScript andbean, none of which are ported.
A predicate is an expression whose result is a boolean. A non-boolean result is an error; there is no truthiness guess, where Camel coerces.
Processors
Section titled “Processors”Processors use Camel’s defaults unless this section says otherwise.
Message transformation
Section titled “Message transformation”setBody, transform, setHeader, setProperty, removeHeader and removeProperty behave as in Camel.
Header names are bounded.
Engine headers prefixed Camel or Adapter, and credential headers, cannot be set or removed.
script runs an expression for effect on properties without changing the body, as Camel’s script EIP does.
Conversion
Section titled “Conversion”convertBodyTo and convertHeaderTo take Camel’s options type, name, toName and mandatory (default true).
charset is not ported.
convertPropertyTo takes the same options as convertHeaderTo.
It is an addition: routes carry intermediate values in properties, where Camel 4 uses variables, which are not ported.
type names a code map, written codeMap:<id>, never a Java type.
A code map maps an ExternalId key to one JSON scalar.
Lookup is exact and case-sensitive over a string input.
A null or absent input passes through unchanged whatever mandatory says.
Any other non-string input, or a miss, raises conversion.unmapped.
With mandatory: false a miss leaves the target absent.
Rhai scripts reach the same lookup through code_map(id, key).
Every typed conversion reference is a literal id that resolves.
adapterctl check refuses a declared map that no typed conversion step references.
A code_map call used only inside a script does not exempt a declared map from that refusal.
Routing
Section titled “Routing”tosends to an endpoint. The URI is static; there is notoD. Anhttpsend may follow an origin-pinned link throughhttpUri.choicewithwhenandotherwise: the first matching predicate wins.filterruns its nested steps only on a match, and the route continues after the filter either way.statusPropertyNameis absent by default; when set, it names an exchange property that records the boolean outcome.stopends the route.validateraises thevalidationclass when its predicate fails.throwExceptionraises a declared catchable error class with a constant message. There is no message expression.
Splitting and aggregation
Section titled “Splitting and aggregation”split takes these options:
expression, which must yield a JSON array. Camel also splits maps and strings; the Adapter does not.aggregationStrategy, defaultuse-originalwithpropagateException: true. The original message returns, and an item failure is raised after every item has run, as Camel’sSplitterdoes.stopOnException, default false.errorThreshold(a ratio from 0 to 1, stopping once the failure ratio reaches it) andmaxFailedRecords(stopping once failures reach it). Each is exclusive withstopOnException.maximumItems, mandatory.
A split sets CamelSplitIndex, CamelSplitSize (set before the first item, because the split does not stream) and CamelSplitComplete.
It sets CamelSplitResult only when errorThreshold or maxFailedRecords is configured.
CamelSplitResult carries the three counts only, and the per-item failure map is dropped so the result stays value-free.
A piece whose failure the accounting counted is left out of the merged result, where Camel folds it with its exception cleared.
parallelProcessing, streaming, timeout, group and onPrepare are not ported.
loop takes an expression count or a doWhile predicate, and copy (default false).
maximumIterations is mandatory.
A count loop sets CamelLoopIndex and CamelLoopSize.
The doWhile predicate is evaluated on the current exchange before every iteration, the first included, so a false predicate runs no iteration.
A count of zero or less runs none either.
Under copy, an error restores the exchange as it stood before the failed iteration, where Camel copies the failed iteration’s own results back.
enrich takes a uri, an aggregationStrategy (default: replace the body with the resource reply) and aggregateOnException (default false).
A failure propagates to the error handler, so a record is never served without its enrichment unless the pack handles the failure.
The URI is static, and there is no pollEnrich on a facade route.
Strategies merge bodies and named properties only.
Aggregation strategies are compiled in and named after Camel’s built-ins:
use-latest.use-original, withpropagateException(default true).grouped-body, which skips null bodies and yields an empty array for an empty split.json-array-append, an addition for JSON bodies, withfrom,intoanduniqueBy. A duplicateuniqueByvalue raisesaggregation.duplicate.json-merge, an addition for JSON bodies, withfromandinto.
A custom strategy is a rhai entrypoint over the old and new bodies, named oldExchange and newExchange.
Resilience
Section titled “Resilience”circuitBreaker follows resilience4j semantics and defaults; the options are listed under circuit breaker.
throttle takes Camel 4’s options: mode (TotalRequests, the default, or ConcurrentRequests), a limit expression, timePeriodMilliseconds (default 1000) and rejectExecution (default false).
A waiting exchange waits at most until its deadline and then raises throttle.rejected.
A send nested inside throttle runs bare from the route’s redelivery policy.
State belongs to the EIP node and is shared by every bound operation and direct: call that reaches that node, for the process lifetime.
Replicas have independent state.
A pack must not use either processor as a per-caller quota, and must not assume a deployment-wide shared state.
Idempotency
Section titled “Idempotency”idempotentConsumer is described in Adapter writes.
Pagination
Section titled “Pagination”Pagination is not an EIP and gets none.
The route reads AdapterContinuation and sets AdapterNextContinuation; the engine owns the caller-facing cursor, as the exchange contract describes.
Two upstream shapes are covered.
One facade page per upstream page is the default and the cheapest bound.
Use one to whose query or httpUri comes from AdapterContinuation, then a setProperty of AdapterNextContinuation from the upstream’s cursor, offset or next link.
Leave it absent on the last page.
Several upstream pages per facade page uses a loop with doWhile over a property that holds the upstream cursor.
Seed the property before the loop so the predicate holds before the first fetch.
Use an enrich per page with json-array-append, uniqueBy and properties, which carries the next cursor or link out of the reply.
Duplicate and shifting pages then fail the exchange instead of merging silently.
The loop’s maximumIterations bounds the calls.
Reaching it raises loop.maximum-iterations-reached, unless the route stops earlier and hands the remainder back as AdapterNextContinuation.
Error handling
Section titled “Error handling”Error handling follows Camel’s error handler, redelivery policy, exception clauses and doTry.
Camel’s Java exception hierarchy becomes a closed hierarchy of error classes.
One failed exchange carries one failure class.
The closest declared ancestor of that class wins, and onWhen narrows a clause.
This single-class failure is a bounded divergence from Camel’s cause-chain match.
Error classes
Section titled “Error classes”Class names are kebab-case segments joined by dots. The catchable hierarchy is:
upstream upstream.http status outside okStatusCodeRange upstream.timeout upstream.connection upstream.malformed body not JSON, or over the depth bound upstream.too-large upstream.redirect redirects are never followedbreaker.openthrottle.rejectedloop.maximum-iterations-reached a doWhile loop still true at maximumIterationsvalidationconversion.unmapped a code map has no entryaggregation.duplicatescript script error inside its budgetoutcome raised by a pack (throwException), never by the engine outcome.not-found the source has no such record outcome.conflict the source refused the write as conflicting outcome.invalid-request the source refused the request as malformed for it outcome.rejected the source refused the write for its own reasonsThe outcome branch is how a pack says what a source meant in profile-neutral terms: a 404, or an import summary with status ERROR inside a 200.
The profile decides the problem a caller sees, as the exchange contract describes.
Five classes are uncatchable, terminal and journaled: budget.exhausted, credential.rejected, disclosure.violation, egress.refused and script.budget-exceeded.
credential.rejected means the upstream refused the deployment’s credential after the single token refresh.
It sits outside upstream, so no clause for upstream matches it.
No onException or doCatch may name an uncatchable class, and adapterctl check refuses a clause that does.
A failure carrying one of them fires no clause.
Ten facade classes are raised by the rest consumer outside any route, so a route can neither catch nor raise them:
facade.unauthenticatedfacade.forbiddenfacade.invalid-request, for contract validationfacade.invalid-cursor, for a cursor that fails validation, answered 400facade.not-found, when no record path matchedfacade.method-not-allowedfacade.unsupported-media-type, for a requestContent-Typethe operation does not acceptfacade.not-acceptable, when no acceptable response media type is inAcceptfacade.conflict, for an idempotency key in flightfacade.idempotency-mismatch, for the same key with a different body
They exist so the profile maps them like every other class: every response a caller receives is in the profile’s shape.
Error handler and redelivery
Section titled “Error handler and redelivery”errorHandler is defaultErrorHandler (Camel’s default: no redelivery, and the error propagates to the caller) or noErrorHandler.
The Dead Letter Channel is not a configurable endpoint: every exhausted exchange is journaled, and the journal is the fixed dead letter.
The redelivery policy applies on the error handler or on an onException clause.
Its options and defaults are:
maximumRedeliveries: default 0, so attempts are one plus this value.retryDelaySeconds: Camel’sredeliveryDelay, default 1 second.useExponentialBackOff: default false.backOffMultiplier: default 2.maximumRetryDelaySeconds: Camel’smaximumRedeliveryDelay, default 60 seconds.useCollisionAvoidance: default false.collisionAvoidanceFactor: default 0.15.
The delay computation is Camel’s RedeliveryPolicy.
The multiplier applies only with useExponentialBackOff and a multiplier above 1.
Collision avoidance varies the delay by plus or minus the factor.
The first delay is retryDelaySeconds.
Each later delay is the previous delay (times the multiplier when backing off), then the collision variance, then the maximumRetryDelaySeconds cap, so the cap bounds the varied delay.
delayPattern is not ported.
During redelivery the exchange carries CamelRedelivered, CamelRedeliveryCounter and CamelRedeliveryMaxCounter.
retryWhile and onWhen can read them.
They are sent upstream only if listed in requestHeaders like any engine header.
Redelivery is per failing top-level endpoint send.
It reaches only an http or graphql to that is a direct child of the route’s step list.
Token requests sit outside it.
A to: direct: send is never redelivered.
An endpoint send inside a nested processor body runs once and bubbles its failure to the enclosing top-level step.
A matching clause may still handle that bubbled failure, except for the bare breaker block described under circuit breaker.
Camel retries from the point of failure without either restriction.
retryWhile is an option of an onException clause and of the default error handler, as in Camel, not of the redelivery policy.
Redelivery continues while the predicate is true.
maximumRedeliveries remains the hard cap, where Camel lets retryWhile replace it, so the maximum number of upstream calls stays a check-time guarantee.
adapterctl check refuses retryWhile with maximumRedeliveries 0.
A retryWhile that raises ends redelivery, as in Camel.
adapterctl check refuses maximumRedeliveries above 0 over a to whose httpMethod is not safe, unless that endpoint operation declares idempotentUpstream: true.
That declaration is a reviewed claim, for example DHIS2 creates with client-supplied UIDs.
Exception clauses
Section titled “Exception clauses”onException takes exception (classes), onWhen, handled, continued, the redelivery options and nested steps.
handled and continued are booleans, where Camel takes predicates.
The clause whose class is the closest ancestor of the raised class wins.
Equally specific clauses keep declaration order.
A subclass clause never matches a superclass failure.
An onWhen that raises means the clause does not match.
Clauses are route-scoped; Camel’s global and routeConfiguration scopes are not ported.
Without an explicit clause policy, a clause with nested output steps uses zero redeliveries. An outputless clause inherits the route policy.
handled: true ends the exchange successfully with the clause’s result.
That result is validated against the operation’s result schema like any route output, for example an empty search page or a fallback record.
continued: true resumes the route at the step after the failure.
An unhandled error surfaces as the profile’s problem for its class, with no upstream content.
The profile’s mapping for the upstream root is the catch-all for source failures.
To translate an error instead, end the clause with throwException.
As in Camel, an error raised inside an exception clause is not handled again and becomes the exchange’s failure, which the profile maps to a problem.
The returned failure carries only the clause’s error, while the journal records the original handling event and the final class.
A direct: route called from a clause is inside the clause, so its errors are not handled again either.
Camel lets the callee’s own error handler fire the clause a second time.
A clause never builds a problem body or sets CamelHttpResponseCode.
Try, catch and finally
Section titled “Try, catch and finally”doTry, doCatch (with onWhen) and doFinally behave as in Camel.
A doTry without a catch or a finally clause is refused before serving; an explicitly empty finally clause is valid.
Inside a doTry block the route error handler is not in use: no onException clause and no redelivery applies to the block’s steps.
An error that no doCatch matches, or one raised in a doCatch or doFinally, leaves the doTry and fails the exchange.
An error raised in doFinally while another is pending is kept as suppressed, and the original wins.
A doCatch onWhen that raises fails the exchange with that error, and the original is journaled separately as suppressed.
A to: direct: inside the block calls a route that keeps its own error handling.
An uncatchable authority, audit, budget or cryptographic failure bypasses doFinally, so cleanup steps cannot issue source effects after a terminal boundary.
Ordinary pending failures still execute doFinally.
Circuit breaker
Section titled “Circuit breaker”circuitBreaker has resilience4j semantics and defaults.
State is per EIP node and process-local, as in Camel, so replicas have independent breakers.
The options and defaults are:
failureRateThreshold: 50.slidingWindowType: count-based.slidingWindowCalls(resilience4jslidingWindowSize): 100.minimumNumberOfCalls: 100.openStateWaitSeconds(resilience4jwaitDurationInOpenState): 60.maximumHalfOpenCalls(resilience4jpermittedNumberOfCallsInHalfOpenState): 10.automaticTransitionFromOpenToHalfOpenEnabled: false.slowCallRateThreshold: 100.slowCallDurationThresholdSeconds: 60.
With automatic transition disabled, an elapsed open wait stays OPEN until the next guarded call. When enabled, passive state observation reflects HALF_OPEN without admitting a trial. The breaker derives the elapsed transition when observed; it starts no timer task.
recordException and ignoreException are optional, unique, non-empty lists from the closed error-class hierarchy.
A named parent covers its descendants.
With recordException, a non-matching catchable failure counts as success and continues the exchange.
An ignoreException match takes precedence, counts as neither success nor failure, and continues the exchange.
Neither continuation runs onFallback, and both journal the consumed failure.
Boundary and facade-only classes are refused in either list, so an uncatchable failure always counts as failure and propagates.
A rejected call always raises breaker.open.
Camel’s default (throwExceptionWhenHalfOpenOrOpenState: false) lets the message continue unchanged, which would answer with the request echoed.
onFallback runs on a recorded failure and on rejection, and its output is validated like any route output.
The guarded steps and the fallback run bare: the route error handler does not wrap the breaker block or its steps.
A recorded error that escapes a breaker without onFallback reaches no onException clause and no route redelivery.
It surfaces as the profile’s problem for its class.
Components
Section titled “Components”direct
Section titled “direct”direct is a synchronous in-process call to another route, with Camel’s semantics and a bounded depth.
rest is the facade consumer, ported from Camel’s contract-first REST DSL (rest().openApi()).
The generated OpenAPI document is the specification.
Every concrete operation dispatches to its bound route.
clientRequestValidation is always on.
Unmatched requests answer 404 or 405, as in Camel.
A missing route fails startup; Camel’s ignore and mock options for missingOperation are not ported.
The engine owns authentication and authorisation, using shared OIDC verification, and the envelope is the profile’s template, filled by the engine.
uri: "http:<endpointId>" names an endpoint declared in the pack and bound to a base URL in the runtime config.
The producer sends on the platform’s fixed-destination transport.
Its parameters are:
httpMethod.path, an origin-relative template that starts with/and is appended to the endpoint’s base path. Its{{name}}segments are filled frompathParametersexpressions and percent-encoded by the engine as single segments. Every placeholder must be bound and every binding must be used.httpUri, used instead ofpath: an expression that yields an absolute link the source returned, pinned to the endpoint’s origin (see origin-pinned links).query, a map from name to expression, encoded by the engine. It is not allowed withhttpUri.body, an expression marshalled to JSON. APOSTsend carries a body, and one without a body is refused.throwExceptionOnFailure, default true.okStatusCodeRange, default200-299: a comma-separated list of status codes and inclusive ranges inside 100 to 599, as Camel writes it.
Camel builds dynamic requests from the CamelHttpPath, CamelHttpQuery and CamelHttpUri headers or from toD.
The Adapter’s requests are structured and encoded by the engine, and the one dynamic form, httpUri, is checked against the origin.
No expression can change the origin or inject a path.
Request headers go out only through the endpoint’s requestHeaders allowlist.
Upstream authentication is one of the closed kinds listed in Authorisation and secrets, declared on the endpoint and injected at send time, after the header allowlist has been applied.
Every http and graphql endpoint declares two bounds, with no default:
attemptTimeoutMilliseconds, from 1 to 10000, covers the whole outbound attempt. A value above the ceiling is refused, never shortened.maximumResponseBytes, from 1 to 1048576.
The runtime binding may lower either, never raise it.
Camel’s connectTimeout, responseTimeout, soTimeout and connectionRequestTimeout collapse into the one attempt timeout, and the facade deadline still bounds the total.
For an ingestion job, the job profile resolves these ceilings under the platform caps, as Adapter ingestion jobs describes.
A send’s safety comes from its method.
A POST whose endpoint operation declares safeUpstream: true counts as safe for the write-safety rules.
That declaration is a reviewed claim, as for FHIR POST _search.
A read operation (a facade get or search binding) reaches only safe sends: adapterctl check refuses a non-safe http send, or a GraphQL mutation, anywhere in its route closure.
Responses behave this way:
- A body over the bound raises
upstream.too-large. - A 3xx raises
upstream.redirectwhateverokStatusCodeRangesays, and is never followed. upstream.httpcovers every other status outside the range.- A failed response keeps its status in
CamelHttpResponseCode, and keeps its body as the exchange body when that body is JSON within the bound, so a clause can read a source’s error detail. TheLocationvalue and the status text are not kept. - An empty body is JSON
null. - A non-JSON body raises
upstream.malformed, also underthrowExceptionOnFailure: false. - A
pathwhose filled and encoded destination exceeds the URL bound fails before a send asoutcome.not-found, so a caller-supplied record identifier does not become an internal egress problem. - An evaluated
httpUriover the same bound is the uncatchableegress.refused, because it is a source-supplied absolute destination.
graphql
Section titled “graphql”graphql is a producer in the shape of Camel’s camel-graphql component, over the same transport as http.
It takes query as a digest-pinned queryFile, operationName and a variables expression.
It has no httpMethod, path, pathParameters or query.
adapterctl check parses the query file and requires the named operation.
A send is safe only when the named operation is a GraphQL query.
A mutation is non-safe under every write-safety rule.
The reply’s data member is the body.
A GraphQL errors array fails the exchange with an upstream.http-class error that carries the declared detail only.
Camel leaves errors in the body; the Adapter fails the exchange even when partial data came back.
Components that are not ported
Section titled “Components that are not ported”Every other Camel component is not ported, including log (it would leak values) and mock outside the test harness.
What is not ported
Section titled “What is not ported”The route language is a closed set of steps, so adapterctl check refuses a route that uses a construct outside it.
These Camel features are deliberately not ported:
- the Java and XML DSLs, the code-first REST DSL and Simple;
bean,processandtoD;- the EIPs
wireTap,multicast,recipientList,routingSlip,dynamicRouter,loadBalance,resequencer,delay,sampleandsaga; - the stateful
aggregateEIP and aggregation repositories; log;- transactions and UnitOfWork;
threadsand parallel processing;- streaming;
- brokers and the rest of the component library;
- route controllers, hot reload and JMX;
- Camel K, Quarkus and Spring runtimes.
pollEnrich is not on this list for ingestion jobs: a job route’s read step is bounded and static-URI only, and the facade never polls.
FTPS stays out until a named adopter needs it, and plain FTP is unsupported.
Cookies on Registry Stack
We use optional cookies to understand how you use the main Registry Stack website and this documentation. If you contact us, we may link this activity to your enquiry. You can change your choice at any time. Read the privacy policy.
Your browser asks sites not to track you, so optional tracking stays off.
We could not use or save that choice. Optional tracking remains off.