Create an Integration
The shortest path from a route to an integration that exists in the platform. Two starting points lead to the same object.
Use this guide when you have a route in mind and want it to exist in the platform. It stops before deployment: at the end, the integration is defined but nothing runs.
Choose the source mode
An integration takes its source from one of two places. The choice is made at creation and can be changed later.
| Inline | Git | |
|---|---|---|
| Source lives in | The integration itself | A repository |
| History, review, releases | No | Yes |
| Use for | Prototypes, small glue routes | Anything that reaches test or production |
Inline Source
- In Runtime Manager, Integrations, Create Integration.
- Name it, choose None — create it on its own, keep Source mode on Inline.
- Add one or several source files in the YAML, Java or XML DSL.
- Leave Expose HTTP Endpoint on if a route consumes HTTP, then create.
Example of an HTTP route
Paste this as a source file named orders.camel.yaml. It answers GET /orders/{id} with a JSON
document that carries the identifier from the path:
- route:
id: get-order
from:
uri: platform-http:/orders/{id}
parameters:
httpMethodRestrict: GET
steps:
- setHeader:
name: Content-Type
constant: application/json
- setBody:
simple: '{"id":"${header.id}","status":"shipped"}'
- log:
message: "order ${header.id} served"
Keep Expose HTTP Endpoint on. Once the integration is deployed, call it at its address:
curl https://<address-of-the-integration>/orders/42
{"id":"42","status":"shipped"}
Example of a scheduled route
This one consumes no HTTP: it writes a line to the log every ten seconds. Turn Expose HTTP Endpoint off for it.
- route:
id: heartbeat
from:
uri: timer:heartbeat
parameters:
period: 10000
steps:
- setBody:
simple: "heartbeat ${date:now:HH:mm:ss}"
- log:
message: "${body}"
Its lines appear in Monitoring, Logs Insight, once it runs.
A route in Java and XML DSL, with the explanation of each step: tutorial, step 1.
Git Source
- In Integration Center, create a repository of type Routes, or from a template.
- Commit the routes, from the Web IDE or with Git.
- In Runtime Manager, create the integration with Source mode on Git and choose the repository, then a branch or a release.
Detail: tutorial, step 7.
Camel Dependencies
Components used in endpoint URIs are resolved for you. Declare the rest in Dependencies. See Camel dependencies.
Verification
The integration is listed in Runtime Manager, not yet deployed. Next: Deploy an integration.