kamelet:<name>?prop=value instead of repeating the underlying route. Grand Central connectors use kamelets for every reusable step: the outbound HTTP call, vendor SDK calls, and the structured exception handlers.
Kamelets are a native Apache Camel concept. For more information, see Apache Camel Kamelets documentation. They run in the connector’s Camel K and Quarkus runtime. Each kamelet is a Kubernetes custom resource (kind: Kamelet). The connector build loads platform and custom kamelets from the classpath.
Platform and upstream kamelet repositories
Thegrandcentral-platform-kamelets repository contains the platform kamelets and publishes them as a Maven artifact (com.backbase.gc.generic:grandcentral-platform-kamelets). Connectors that use grandcentral-bom already depend on this artifact. Call a platform kamelet by name (kamelet:<name>). Each kamelet is one *.kamelet.yaml file under src/main/resources/kamelets.
- Platform kamelets: bb-ecos-core/grandcentral-platform-kamelets
- Upstream catalog and examples: apache/camel-kamelets
gc-http-caller kamelet. For more information, see Call REST endpoints. For more information about error mapping, see Exception-handler kamelets.
Kamelet types
Every kamelet declares its type through thecamel.apache.org/kamelet.type label. The following table shows the three types.
Anatomy of a kamelet
A kamelet is one YAML document with four parts: metadata, adefinition (its public contract), its dependencies, and a template (the route itself). The following sample is a shortened gc-http-caller. It keeps the URL step. For the full property list, see Call REST endpoints.
metadata.namemust match the file name (<name>.kamelet.yaml) and is the name callers use inkamelet:<name>.spec.definitionis a JSON Schema. Eachpropertiesentry becomes a query parameter. Give every property atitle,description,type, and adefaultwhere sensible; list mandatory ones underrequired.{{property}}interpolates a declared property into the route. Use{{?property}}for an optional one that may be unset.kamelet:sourceandkamelet:sinkare the fixed input and output endpoints that wire the kamelet into the caller’s exchange. Asourceor anactionreads fromkamelet:sourceand ends withto: kamelet:sink. Asinkreads fromkamelet:sourceand routes to the external system instead.spec.dependenciesmust list every Camel component and Maven artifact the template uses, so the runtime resolves them at build time.
How a connector calls a kamelet
From a connector route, address the kamelet by name and pass properties as query parameters:gc-http-caller contract, see Call REST endpoints.
Create a custom kamelet
Add a custom kamelet only when no platform or upstream kamelet fits, such as a vendor SDK caller or a transformation shared across operations. To add the kamelet, follow these steps:- Name it. Choose a lowercase, hyphenated name and create
src/main/resources/kamelets/<name>.kamelet.yaml. Match the naming convention (for example<vendor>-api-caller,<vendor>-properties, or<purpose>-handler). - Pick the type. Set
camel.apache.org/kamelet.typetosource,sink, oraction. - Define the contract. Under
spec.definition.properties, declare each input withtitle,description,type, and adefault. Add required inputs torequired. Keep the contract small, and prefer sensible defaults over many mandatory properties. - Declare dependencies. List every Camel component and Maven artifact under
spec.dependencies. - Write the route. For a
sourceor anaction, startspec.template.fromatkamelet:source, add thesteps, reference the beans you need, and finish withto: kamelet:sink. For asink, start atkamelet:sourceand route to the external system instead ofkamelet:sink. Interpolate properties with{{property}}or{{?property}}. - Package it. Keep the file under
src/main/resources/kamelets/. The connector build packages that file with the connector. Thegrandcentral-bomdependency provides the platform kamelets. - Run the connector. On a cluster, use
mvn kamel:dev. For more information, see Test and validate. - Document the inputs. Add the kamelet, its properties, exchange properties, and defaults to the table in the connector repository
READMEfile. Other connector developers use that table when they call the kamelet.
Kamelet tools
- Kameleon: a standalone web editor for writing and revising kamelet YAML. Use it to draft the
definitionandtemplatebefore you commit the file. mvn kamel:dev: builds the connector and runs it on the cluster. For more information, see Test and validate.- Apache reference: the Kamelet development guide, which documents every field and additional options such as data types and error handling.