You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2026/06/01 13:58:30 UTC

(camel-jbang-examples) branch main updated (72c86a3 -> 0e243fb)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel-jbang-examples.git


    from 72c86a3  Add infra services metadata
     new fe19aae  Udate cron example
     new 0a737f2  Add route-topology example with order processing system
     new 0e243fb  Polished

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 camel-jbang-example-catalog.json         | 20 +++++++
 cron-log/application.properties          |  2 -
 cron-log/cron-log.camel.yaml             |  6 +--
 route-topology/README.md                 | 61 +++++++++++++++++++++
 route-topology/application.properties    |  3 ++
 route-topology/metadata.json             | 12 +++++
 route-topology/route-topology.camel.yaml | 93 ++++++++++++++++++++++++++++++++
 7 files changed, 191 insertions(+), 6 deletions(-)
 create mode 100644 route-topology/README.md
 create mode 100644 route-topology/application.properties
 create mode 100644 route-topology/metadata.json
 create mode 100644 route-topology/route-topology.camel.yaml


(camel-jbang-examples) 03/03: Polished

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-jbang-examples.git

commit 0e243fb13e8e7400b4bdea884e862ac8c7f84651
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Jun 1 15:58:14 2026 +0200

    Polished
---
 camel-jbang-example-catalog.json | 20 ++++++++++++++++++++
 route-topology/README.md         |  8 ++++----
 2 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/camel-jbang-example-catalog.json b/camel-jbang-example-catalog.json
index 10c4a6e..20def5c 100644
--- a/camel-jbang-example-catalog.json
+++ b/camel-jbang-example-catalog.json
@@ -372,6 +372,26 @@
             "rest-api.camel.yaml"
         ]
     },
+    {
+        "name": "route-topology",
+        "title": "Route Topology",
+        "description": "Demonstrates inter-route topology with triggers, shared routes, and external systems",
+        "level": "intermediate",
+        "tags": [
+            "topology",
+            "direct",
+            "kafka",
+            "timer"
+        ],
+        "bundled": true,
+        "requiresDocker": false,
+        "hasCitrusTests": false,
+        "files": [
+            "README.md",
+            "application.properties",
+            "route-topology.camel.yaml"
+        ]
+    },
     {
         "name": "routes",
         "title": "Routes",
diff --git a/route-topology/README.md b/route-topology/README.md
index 358707f..194f09d 100644
--- a/route-topology/README.md
+++ b/route-topology/README.md
@@ -25,7 +25,7 @@ Sample output:
 
 ```
     ┌──────────────────────┐    ┌──────────────────────┐
-    │   Generate Orders    │    │    Order REST API     │
+    │   Generate Orders    │    │    Order REST API    │
     │          54          │    └──────────────────────┘
     └──────────────────────┘
                 │                           │
@@ -33,21 +33,21 @@ Sample output:
                 └─────────────│
                               ▼
                   ┌──────────────────────┐
-                  │    Process Order      │
+                  │    Process Order     │
                   │          54          │
                   └──────────────────────┘
                               │
                 ┬─────────────┴─────────────┬
                 ▼                           ▼
     ┌──────────────────────┐    ┌──────────────────────┐
-    │    Dispatch Order     │    │    Validate Order     │
+    │    Dispatch Order    │    │    Validate Order    │
     │          54          │    │          54          │
     └──────────────────────┘    └──────────────────────┘
                 │
                 └───────────────────────────┬
                 ▼                           ▼
     ┌──────────────────────┐    ┌──────────────────────┐
-    │    Fulfill Order      │    │  Send Notification    │
+    │    Fulfill Order     │    │  Send Notification   │
     │          54          │    │          54          │
     └──────────────────────┘    └──────────────────────┘
 ```


(camel-jbang-examples) 01/03: Udate cron example

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-jbang-examples.git

commit fe19aaecaaa4282c7d62d8c621746330fcb7cf6c
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat May 30 20:24:01 2026 +0200

    Udate cron example
---
 cron-log/application.properties | 2 --
 cron-log/cron-log.camel.yaml    | 6 ++----
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/cron-log/application.properties b/cron-log/application.properties
index b99fbbe..476729c 100644
--- a/cron-log/application.properties
+++ b/cron-log/application.properties
@@ -1,4 +1,2 @@
-# Timer period in milliseconds
-cron.period=5000
 # Log message prefix
 cron.message=Scheduled task running at
diff --git a/cron-log/cron-log.camel.yaml b/cron-log/cron-log.camel.yaml
index 8739f72..dee6b1c 100644
--- a/cron-log/cron-log.camel.yaml
+++ b/cron-log/cron-log.camel.yaml
@@ -1,10 +1,9 @@
 - route:
     id: cron-log
     from:
-      uri: timer
+      uri: cron:tab
       parameters:
-        timerName: cron
-        period: "{{cron.period}}"
+        schedule: "0/5 * * * * ?"
       steps:
         - setBody:
             expression:
@@ -12,4 +11,3 @@
                 expression: "{{cron.message}} ${date:now:HH:mm:ss}"
         - log:
             message: "${body}"
-


(camel-jbang-examples) 02/03: Add route-topology example with order processing system

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-jbang-examples.git

commit 0a737f254949567c71e687a172bbbc09d96a66f4
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Jun 1 15:56:35 2026 +0200

    Add route-topology example with order processing system
    
    Co-Authored-By: Claude Opus 4.6 <no...@anthropic.com>
---
 route-topology/README.md                 | 61 +++++++++++++++++++++
 route-topology/application.properties    |  3 ++
 route-topology/metadata.json             | 12 +++++
 route-topology/route-topology.camel.yaml | 93 ++++++++++++++++++++++++++++++++
 4 files changed, 169 insertions(+)

diff --git a/route-topology/README.md b/route-topology/README.md
new file mode 100644
index 0000000..358707f
--- /dev/null
+++ b/route-topology/README.md
@@ -0,0 +1,61 @@
+## Route Topology
+
+This example demonstrates inter-route topology in an order processing system.
+It showcases how multiple routes connect through shared endpoints — both internal (direct)
+and external (kafka) — making it a good example for the `route-topology` command.
+
+### How to run
+
+    camel run route-topology.camel.yaml
+
+You can use `--stub` to run without a Kafka broker installed.
+This replaces Kafka with an internal in-memory queue, so the routes still connect and messages flow end-to-end:
+
+    camel run route-topology.camel.yaml --stub=kafka
+
+### View the route topology
+
+    camel cmd route-topology
+
+View as a Unicode diagram with live metrics and route descriptions:
+
+    camel cmd route-topology --theme=unicode --metric --description
+
+Sample output:
+
+```
+    ┌──────────────────────┐    ┌──────────────────────┐
+    │   Generate Orders    │    │    Order REST API     │
+    │          54          │    └──────────────────────┘
+    └──────────────────────┘
+                │                           │
+                │             ┬─────────────┘
+                └─────────────│
+                              ▼
+                  ┌──────────────────────┐
+                  │    Process Order      │
+                  │          54          │
+                  └──────────────────────┘
+                              │
+                ┬─────────────┴─────────────┬
+                ▼                           ▼
+    ┌──────────────────────┐    ┌──────────────────────┐
+    │    Dispatch Order     │    │    Validate Order     │
+    │          54          │    │          54          │
+    └──────────────────────┘    └──────────────────────┘
+                │
+                └───────────────────────────┬
+                ▼                           ▼
+    ┌──────────────────────┐    ┌──────────────────────┐
+    │    Fulfill Order      │    │  Send Notification    │
+    │          54          │    │          54          │
+    └──────────────────────┘    └──────────────────────┘
+```
+
+Save as PNG image:
+
+    camel cmd route-topology --theme=dark --output=topology.png
+
+### View as JSON
+
+    camel cmd route-topology --json
diff --git a/route-topology/application.properties b/route-topology/application.properties
new file mode 100644
index 0000000..663bdcf
--- /dev/null
+++ b/route-topology/application.properties
@@ -0,0 +1,3 @@
+# Kafka defaults to localhost:9092
+# To use a different broker, uncomment and adjust:
+# camel.component.kafka.brokers=localhost:9092
diff --git a/route-topology/metadata.json b/route-topology/metadata.json
new file mode 100644
index 0000000..7737777
--- /dev/null
+++ b/route-topology/metadata.json
@@ -0,0 +1,12 @@
+{
+    "title": "Route Topology",
+    "description": "Demonstrates inter-route topology with triggers, shared routes, and external systems",
+    "tags": [
+        "topology",
+        "direct",
+        "kafka",
+        "timer"
+    ],
+    "bundled": true,
+    "level": "intermediate"
+}
diff --git a/route-topology/route-topology.camel.yaml b/route-topology/route-topology.camel.yaml
new file mode 100644
index 0000000..8657d97
--- /dev/null
+++ b/route-topology/route-topology.camel.yaml
@@ -0,0 +1,93 @@
+# Order Processing System
+# This example demonstrates inter-route topology with triggers, shared routes, and external systems.
+# Use "camel cmd route-topology" to visualize how the routes connect to each other.
+
+# Trigger: generates a new order every 5 seconds
+- route:
+    id: order-generator
+    description: Generate Orders
+    from:
+      uri: timer
+      parameters:
+        timerName: orders
+        period: 5000
+      steps:
+        - setBody:
+            expression:
+              simple:
+                expression: '{"orderId": "${exchangeId}", "item": "Camel T-Shirt", "quantity": 1}'
+        - to:
+            uri: direct:process-order
+
+# HTTP entry point: receives orders from external clients
+- route:
+    id: order-api
+    description: Order REST API
+    from:
+      uri: platform-http
+      parameters:
+        path: /api/orders
+        httpMethodRestrict: POST
+      steps:
+        - to:
+            uri: direct:process-order
+
+# Shared route: validates and publishes orders (used by both order-generator and order-api)
+- route:
+    id: process-order
+    description: Process Order
+    from:
+      uri: direct:process-order
+      steps:
+        - to:
+            uri: direct:validate-order
+        - log:
+            message: "Processing order: ${body}"
+        - to:
+            uri: kafka:orders
+
+# Validation: checks order contents
+- route:
+    id: validate-order
+    description: Validate Order
+    from:
+      uri: direct:validate-order
+      steps:
+        - log:
+            message: "Validating order: ${body}"
+
+# Kafka consumer: picks up orders and fans out to fulfillment and notifications
+- route:
+    id: order-dispatcher
+    description: Dispatch Order
+    from:
+      uri: kafka:orders
+      steps:
+        - log:
+            message: "Dispatching order: ${body}"
+        - multicast:
+            steps:
+              - to:
+                  uri: kafka:fulfillment
+              - to:
+                  uri: kafka:notifications
+
+# Kafka consumer: handles fulfillment
+- route:
+    id: fulfillment
+    description: Fulfill Order
+    from:
+      uri: kafka:fulfillment
+      steps:
+        - log:
+            message: "Fulfilling order: ${body}"
+
+# Kafka consumer: sends notifications
+- route:
+    id: notification
+    description: Send Notification
+    from:
+      uri: kafka:notifications
+      steps:
+        - log:
+            message: "Sending notification for: ${body}"