Reusable integration building blocks — parameterized route snippets that can be shared across projects.
|
Attribute |
Details |
|---|---|
|
Purpose |
Define reusable route patterns that can be instantiated with different parameters |
|
Format |
YAML only — files must end with |
|
Directory |
|
|
Loaded by |
Camel context at startup — deploys as Camel route templates |
|
Enabled by |
|
Enabling Kamelets
Kamelets are disabled by default. Enable in config/application.properties:
integration.kamelets.config.enabled=true
integration.kamelets.config.type=fs
integration.kamelets.config.path=kamelets
File Naming
Files must use the .kamelet.yaml suffix and contain kind: Kamelet. Example: csv-import.kamelet.yaml.
When to Use
Use kamelets when you have a repeating pattern across multiple routes — for example, the same "fetch from SFTP, unmarshal, load to Pricefx" pattern used for different object types. Define the template once and instantiate it with parameters.
Example
kamelets/csv-import.kamelet.yaml:
apiVersion: camel.apache.org/v1
kind: Kamelet
metadata:
name: csv-import
spec:
definition:
title: CSV Import
description: Import a CSV file into Pricefx
properties:
objectType:
title: Object Type
type: string
mapper:
title: Mapper ID
type: string
importDir:
title: Import Directory
type: string
template:
from:
uri: "file:{{importDir}}"
steps:
- to: "pfx-csv:unmarshal"
- to: "pfx-api:loaddata?objectType={{objectType}}&mapper={{mapper}}"
Common Pitfalls
-
YAML only — files must end with
.kamelet.yaml. Files with other extensions are ignored. -
kind: Kameletrequired — YAML content must containkind: Kameletor the kamelet is rejected at startup. -
Disabled by default — set
integration.kamelets.config.enabled=trueor no kamelets will load. -
{{parameter}}syntax — same as property placeholders. Use unique parameter names to avoid collisions. -
Restart required — kamelets are loaded at startup. Changes take effect after restart.