Skip to main content

Camel X Template Reference

The templates the platform publishes, offered with the Camel X source in the template selection. Each is a complete integration in Camel YAML DSL (Camel 4.22, Camel Quarkus 3.39), with its error handling, and was run against its systems, on its nominal path and on each failure listed, before it was published. Its README lists the properties to set. The wiki of its repository has three pages:

Wiki pageWhat it gives
Homethe flow, the files, the error handling, how to run it locally
How to usethe steps to create a project from it and deploy it, and every property: definition, explanation, how to change it
Enterprise use casesconcrete cases it covers (systems, SaaS, on-premise or legacy hosting, protocols), what to adapt for each, and when another template fits better

To start from one: Create from a template. Why they are built the way they are: Repository Template Model.

Template categories​

The template selection groups the templates by the category of their manifest .camel.json, the sections below follow the same categories, and each template is shown under its title with the repository name below it. blank stands apart, as Start from scratch: an empty integration, no route and no component, everything written from scratch.

APIs​

TemplateWhat it doesPatternsSystems
rest-to-httpsREST API answered by an HTTPS backend; every backend failure turned into a statusrequest validation, circuit breaker with timeout and fallback, JSONata mappingHTTPS
order-intake-apiContract-first order API that a client can call again safelyOpenAPI contract, JSON Schema, Idempotency-Key, transactional outboxPostgreSQL, Kafka
price-aggregator-apiAsks every supplier in parallel and answers with the best sellable offerscatter-gather with a timeout, normalisation per supplier, partial answersHTTPS
soap-to-rest-facadeREST/JSON API in front of a legacy SOAP serviceenvelope template, XSLT 3.0 to JSON, SOAP faults to HTTP statusesSOAP

Events and messaging​

TemplateWhat it doesPatternsSystems
timer-http-to-kafkaPolls an HTTPS source every minute and publishes each item once, by statesplit, idempotent consumer, content-based router, dead letter channelHTTPS, Kafka
kafka-to-httpsDelivers Kafka records to an HTTPS servicerefusals parked at once, exponential back-off, dead letter topicKafka, HTTPS
cdc-postgres-to-kafkaPublishes every insert, update and delete of chosen tables, one topic per tablechange data capture with Debezium, keyed events, capture waits for KafkaPostgreSQL, Kafka

Files and transfers​

TemplateWhat it doesPatternsSystems
csv-to-databaseLoads CSV files line by line; rejected lines set aside, unreadable files moved asidesplit, JSONata typing, Flyway schemafiles, PostgreSQL
sftp-to-sftpMoves files between two SFTP servers, sorted by typetemporary name while writing, retries, .failed folderSFTP
partner-files-s3Checks partner CSV files row by row and writes one stock summary per warehousequarantine of a whole file, aggregator over a time windowS3

CRM​

TemplateWhat it doesPatternsSystems
lead-capture-apiTakes leads from a web form and records them in the CRM, without duplicating known contactsJSON Schema, consent check, deduplication, retries then 503 with Retry-AfterCRM API
contacts-db-to-crmKeeps the CRM's contacts in step with the customer databaseincremental sync on (updated_at, id), throttling, upsert by external id, error tablePostgreSQL, CRM API
crm-webhook-to-kafkaReceives the CRM's webhooks and publishes each event once, by familyshared token, JSON Schema, idempotent consumer, routing by event typeCRM webhooks, Kafka
deal-won-to-erpTurns a won deal into an ERP invoice and writes its number back on the dealmulti-step orchestration, Idempotency-Key, retries then parkingKafka, ERP API, CRM API
crm-export-to-s3Exports every CRM contact each night as one JSON Lines file, partitioned by dateQuartz cron, loop over pages, page retries, all-or-nothingCRM API, S3

XML and JSONata​

TemplateWhat it doesPatternsSystems
ubl-invoice-to-erpBooks UBL 2.1 e-invoices (Peppol BIS Billing 3.0) in the ERP, once per supplier and numberOASIS XSD with validator, EN 16931 rule in XPath, XSLT 3.0 to JSON, idempotent consumerHTTPS, ERP API
large-xml-feed-to-kafkaPublishes the products of a BMEcat catalogue of any size, one by one as the file streamssplit streaming with xtokenize (StAX), jacksonXml, JSONata, products in error set asidefiles, Kafka
payment-file-iso20022Turns approved payments into SEPA credit transfer files for the bankIBAN check digits in JSONata, aggregator per execution date, xj and XSLT to pain.001.001.09, XSD before sendingKafka, SFTP
xml-content-routerSends each XML document of a shared topic to the topic of its type, a legacy format converted to UBLcontent-based router on root namespace in XPath, XSLT conversion, unrouted documents set asideKafka
canonical-order-hubMaps the order webhooks of Shopify, WooCommerce and Magento 2 to one canonical orderone JSONata mapping per source chosen by toD, JSON Schema of the canonical modelHTTPS webhooks, Kafka

Salesforce​

TemplateWhat it doesPatternsSystems
salesforce-cdc-to-kafkaPublishes the Change Data Capture events of Salesforce, one record per changed record and one topic per objectPub/Sub API subscription, replay id kept on a volume, capture waits for KafkaSalesforce, Kafka
erp-to-salesforce-bulk-upsertKeeps Salesforce accounts in step with the ERP, thousands at a timeincremental read on (updated_at, id), Bulk API 2.0 upsert by external id, job followed to its end, refused rows keptPostgreSQL, Salesforce

The two Salesforce templates were tested against WireMock and the local broker, not against a Salesforce org: the OAuth login, the Bulk API 2.0 calls and the processing of change events were, the gRPC subscription of the Pub/Sub API was not. Each wiki says what was tested; test against a Developer Edition org before production.

B2B and EDI​

TemplateWhat it doesPatternsSystems
as2-inbound-edi-to-kafkaAS2 server for trading partners: EDIFACT interchanges published to one topic per message typedecryption, signature check, signed MDN sent once on Kafka, idempotent consumer on the control referenceAS2, Kafka
kafka-to-as2-outboundSends interchanges to a trading partner over AS2signed and encrypted, signed MDN asked, disposition read from the MDN, refusals parked, retriesKafka, AS2

Tested against OpenAS2 4.5.0 as the partner.

Identity and directory​

TemplateWhat it doesPatternsSystems
directory-lookup-apiREST API over the company directory: a person with manager and groupsLDAP filter injection refused, results to JSON, 503 when the directory is downLDAP
hr-to-ldap-provisioningApplies joiners, movers and leavers of the HR system to the directoryLDIF changes checked one by one, leavers out of every group then moved, connection reopenedKafka, LDAP

Tested against OpenLDAP.

Data warehouse​

TemplateWhat it doesPatternsSystems
kafka-to-snowflakeLoads Kafka events into Snowflake tables within minutesconsumer in batching mode, JDBC batch into staging, MERGE on the last version, offsets committed after the loadKafka, Snowflake
snowflake-to-salesforceBrings scores computed in Snowflake to the Salesforce accounts (reverse ETL)incremental read on (SCORED_AT, ERP_ID), Bulk API 2.0 upsert, position and refused rows kept in SnowflakeSnowflake, Salesforce

Both were tested with the Snowflake JDBC driver against fakesnow, an emulator that runs the Snowflake SQL dialect on DuckDB, not against a Snowflake account.

What a template expects​

TemplateSecrets, given to the integration asStorageReplicas
csv-to-database, order-intake-api, contacts-db-to-crmDB_PASSWORDa volume for the input files (csv-to-database)one for contacts-db-to-crm
sftp-to-sftpSOURCE_SFTP_PASSWORD, TARGET_SFTP_PASSWORDthe known_hosts fileany
cdc-postgres-to-kafkaCDC_DB_PASSWORDa persistent volume for the offset fileone
partner-files-s3S3_ACCESS_KEY, S3_SECRET_KEY—one
lead-capture-apiCRM_TOKEN—any
crm-webhook-to-kafkaCRM_WEBHOOK_TOKEN—any; each replica recognises only the duplicates it received
deal-won-to-erpERP_TOKEN, CRM_TOKEN—any
crm-export-to-s3CRM_TOKEN, S3_ACCESS_KEY, S3_SECRET_KEY—one
ubl-invoice-to-erpERP_TOKEN—one, or more with the ERP's Idempotency-Key
large-xml-feed-to-kafka—a volume for the cataloguesone
payment-file-iso20022BANK_SFTP_PASSWORDthe known_hosts file of the bank serverone
salesforce-cdc-to-kafkaSF_CLIENT_ID, SF_CLIENT_SECRETa persistent volume for the replay positionone
erp-to-salesforce-bulk-upsertDB_PASSWORD, SF_CLIENT_ID, SF_CLIENT_SECRET—one
as2-inbound-edi-to-kafka, kafka-to-as2-outboundAS2_KEYSTORE_PASSWORDthe AS2 keystore: our key, the partner certificateone inbound; outbound up to the partitions
directory-lookup-apiLDAP_BIND_PASSWORD—two or more
hr-to-ldap-provisioningLDAP_BIND_PASSWORD—one
kafka-to-snowflakethe Snowflake private key, as a mounted file—up to the partitions
snowflake-to-salesforcethe Snowflake private key, SF_CLIENT_ID, SF_CLIENT_SECRET—one

The other templates need no secret of their own; the credentials of their target systems, when there are some, are stored in Secret Manager and read as properties. Addresses, topics, buckets and tuning values are properties with a default, to set for each environment.

Files of a template​

Every template has the same layout under src/main/resources:

PathHolds
routes/<api-id>.camel.yamlthe REST contract, or a reference to api/*.yaml
routes/route-<id>.camel.yamlone route
routes/configuration-<id>.camel.yamlone route configuration: the error handling of the routes that name it
routes/beans.camel.yamlbeans declared in YAML
api/OpenAPI contracts
schema/JSON Schemas the input is validated against
mapping/JSONata mappings
xsd/XML Schemas, as their standards body publishes them
xslt/XSLT stylesheets
db/migration/Flyway migrations, run at start-up
application.propertiesevery value, overridable per environment

At the root, .camel.json is the manifest of the project: its Camel dependencies, and the title the catalog shows. The README lists the files above with the role of each, taken from the description of its routes.

Topics​

The template selection matches topics. The Camel X templates use the system (kafka, postgresql, s3, sftp, soap, crm, erp), the protocol or style (api, openapi, webhook, https, xml, ubl, iso20022, salesforce), and the pattern (dead-letter-channel, idempotent-consumer, outbox, cdc, scatter-gather, aggregator, throttle, orchestration, content-based-router, canonical-model, streaming).