Connecting to another system
Camel 5 · 3:59
An integration that calls an outside HTTP service needs extra libraries, declared in integration.yaml and resolved by the hub from Maven Central when you publish. The video also covers kamelets, the reusable building blocks of Camel.
What it covers
- Calling an example service and logging fields from its JSON reply
- Declaring
camel:httpandcamel:jacksonin the dependencies list ofintegration.yaml - The two dependency forms, a Camel component name and
mvn:group:artifact:version - A misspelled dependency, found in the build log with
weikio logs --build --version - The project's kamelets, listed with
weikio get kameletsand on the project page - Writing kamelets to disk with
weikio kamelets pull, for a run without the hub
Commands in this video
Terminal
$ weikio run ./hello
$ weikio logs sandbox/hello --build --version 0.1.6
$ weikio get kamelets
$ weikio kamelets pull ./kameletsTranscript
- 0:02hello runs in devtest, and everything it reads arrived in the last video.
- 0:06This video connects it to another system, and shows what the hub builds for it.
- 0:15hello's route builds an Authorization header on every tick,
- 0:18and logs the message.
- 0:20No step sends the header anywhere; it has no receiver yet.
- 0:24This video gives the header a receiver:
- 0:27a small example service that answers JSON.
- 0:30The route gains the call and the parse of the reply,
- 0:33and logs its fields.
- 0:37The folder holds three files;
- 0:39the route file is where the call goes.
- 0:45The call and the parse need two
- 0:46libraries the JVM does not start with.
- 0:49They are declared in integration.yaml,
- 0:52in a dependencies list.
- 0:54camel:http brings the HTTP component;
- 0:58camel:jackson brings the JSON one.
- 1:01run publishes the folder,
- 1:03and the hub resolves the libraries at publish, from Maven Central.
- 1:10The new version starts,
- 1:11and the log line now shows the reply.
- 1:16On the drawing,
- 1:17hello's ticks now end in a call to erp.example.
- 1:23The call carries the Authorization
- 1:24header from the last video.
- 1:29The service answers with one JSON document;
- 1:33the route logs its fields.
- 1:39The dependencies list takes two forms.
- 1:41camel:http names one of Camel's own components,
- 1:45at the version the platform builds with.
- 1:48mvn:group:artifact:version is the other form:
- 1:52the coordinates of one library, with its version.
- 1:55A misspelt name is the easiest mistake here,
- 1:58so this video makes one.
- 2:00The c drops out of jackson, and run still succeeds.
- 2:04The row reads updated:
- 2:05the platform's own libraries are in every build.
- 2:08Nothing at the site moves; the same reply keeps arriving.
- 2:15The whole build log is one command away.
- 2:19logs with --build and --version prints what the hub did,
- 2:25step by step.
- 2:29The c is put back,
- 2:30and run publishes the fix as a new version, 0.1.7.
- 2:38The log line shows the parsed reply's fields.
- 2:45Camel also has reusable building blocks, called kamelets.
- 2:49get kamelets lists the ones this project shares,
- 2:52and the five the platform ships.
- 2:55A project's kamelet is added by pasting its YAML;
- 2:58every integration of the project then builds with it.
- 3:01A kamelet.yaml file in the folder is the integration's own,
- 3:06and wins at the build.
- 3:11The same list sits on the project page.
- 3:14Each row shows its source, and new kamelets are pasted in.
- 3:21For a run without the hub, the kamelets must be on disk.
- 3:25kamelets pull writes each one beside
- 3:27the integration as a .kamelet.yaml file.
- 3:35hello calls another system, from five declared lines in two files.
- 3:41The hub resolved the libraries at publish, and the call's reply came back parsed.
- 3:46Video nine takes this integration to production.
Next in this track
Camel 6 · 3:03 Custom metrics Watched