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


The following commit(s) were added to refs/heads/main by this push:
     new c703349  Camel 1 tribute example
c703349 is described below

commit c7033491e5b101a5c50f5a4e253611822eddb644
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Jun 10 22:46:06 2026 +0200

    Camel 1 tribute example
---
 camel-1-tribute/README.md              | 87 ++++++++++++++++++++++++++++++++++
 camel-1-tribute/application.properties | 17 +++++++
 camel-1-tribute/jms-to-file.camel.yaml | 35 ++++++++++++++
 camel-1-tribute/metadata.json          | 16 +++++++
 camel-jbang-example-catalog.json       | 24 ++++++++++
 5 files changed, 179 insertions(+)

diff --git a/camel-1-tribute/README.md b/camel-1-tribute/README.md
new file mode 100644
index 0000000..f1c50b9
--- /dev/null
+++ b/camel-1-tribute/README.md
@@ -0,0 +1,87 @@
+## Camel 1.0 Tribute - JMS to File
+
+A tribute to the very first Apache Camel example ever written.
+
+When Apache Camel 1.0 was released in June 2007, the project shipped with just 
two examples.
+The first and most iconic was `camel-example-jms-file` - a simple route that 
consumed messages
+from a JMS queue and saved them to the file system.
+
+Back then, Camel was still part of the Apache ActiveMQ project. The README was 
signed
+_"The Apache ActiveMQ team"_, the website lived at `activemq.apache.org/camel`,
+and classes like `CamelTemplate` (later renamed to `ProducerTemplate`) were 
brand new.
+
+The original example looked like this:
+
+```java
+CamelContext context = new DefaultCamelContext();
+
+ConnectionFactory connectionFactory =
+    new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
+context.addComponent("test-jms",
+    JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
+
+context.addRoutes(new RouteBuilder() {
+    public void configure() {
+        from("test-jms:queue:test.queue").to("file://test");
+    }
+});
+
+CamelTemplate template = new CamelTemplate(context);
+context.start();
+
+for (int i = 0; i < 10; i++) {
+    template.sendBody("test-jms:queue:test.queue", "Test Message: " + i);
+}
+```
+
+That was 40+ lines of Java, a Maven project, ActiveMQ embedded in-process,
+and manual component wiring.
+
+Today, the same example is a single YAML file and one command.
+
+### Running the example
+
+Start an Apache ActiveMQ Artemis broker:
+
+```sh
+$ camel infra run artemis
+```
+
+Or with Docker manually:
+
+```sh
+$ docker run --detach --name mycontainer -p 61616:61616 -p 8161:8161 --rm 
apache/activemq-artemis:latest-alpine
+```
+
+Then run the example:
+
+```sh
+$ camel run *
+```
+
+Camel will send 10 test messages to the `test.queue` JMS queue (just like the 
original)
+and consume them back, saving each message as a file in the `test` directory.
+
+### What changed in 19 years
+
+| | Camel 1.0 (2007) | Camel CLI (today) |
+|---|---|---|
+| **Language** | Java (40+ lines) | YAML (25 lines) |
+| **Build** | Maven project with pom.xml | No build needed |
+| **Broker** | Embedded ActiveMQ (in-process) | Apache ActiveMQ Artemis 
(container) |
+| **Component setup** | Manual `ConnectionFactory` wiring | Auto-configured 
via properties |
+| **Run command** | `mvn camel:run` | `camel run *` |
+| **Dependencies** | Declared in pom.xml | Auto-downloaded |
+
+What stayed the same: `from("jms:queue:test.queue").to("file://test")` - the 
core routing idea
+that made Camel what it is today.
+
+### Help and contributions
+
+If you hit any problem using Camel or have some feedback, then please
+[let us know](https://camel.apache.org/community/support/).
+
+We also love contributors, so
+[get involved](https://camel.apache.org/community/contributing/) :-)
+
+The Camel riders!
diff --git a/camel-1-tribute/application.properties 
b/camel-1-tribute/application.properties
new file mode 100644
index 0000000..79bbe78
--- /dev/null
+++ b/camel-1-tribute/application.properties
@@ -0,0 +1,17 @@
+# artemis connection factory
+camel.beans.artemisCF = 
#class:org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory
+# URL for broker
+camel.beans.artemisCF.brokerURL = tcp://localhost:61616
+
+# if broker requires specific login
+camel.beans.artemisCF.user = artemis
+camel.beans.artemisCF.password = artemis
+
+# pooled connection factory
+camel.beans.poolCF = 
#class:org.messaginghub.pooled.jms.JmsPoolConnectionFactory
+camel.beans.poolCF.connectionFactory = #bean:artemisCF
+camel.beans.poolCF.maxSessionsPerConnection = 500
+camel.beans.poolCF.connectionIdleTimeout = 20000
+
+# setup JMS component to use connection factory
+camel.component.jms.connection-factory = #bean:poolCF
diff --git a/camel-1-tribute/jms-to-file.camel.yaml 
b/camel-1-tribute/jms-to-file.camel.yaml
new file mode 100644
index 0000000..582d025
--- /dev/null
+++ b/camel-1-tribute/jms-to-file.camel.yaml
@@ -0,0 +1,35 @@
+- route:
+    id: jms-to-file
+    description: "Camel 1.0 tribute: consume from JMS queue and save to file"
+    from:
+      uri: jms
+      parameters:
+        destinationName: test.queue
+      steps:
+        - log:
+            message: "Received: ${body}"
+        - to:
+            uri: file
+            parameters:
+              directoryName: test
+
+- route:
+    id: send-test-messages
+    description: "Send 10 test messages to JMS queue (just like the original 
example)"
+    from:
+      uri: timer
+      parameters:
+        timerName: sender
+        repeatCount: 10
+        period: 1000
+      steps:
+        - setBody:
+            expression:
+              simple:
+                expression: "Test Message: 
${exchangeProperty.CamelTimerCounter}"
+        - log:
+            message: "Sending: ${body}"
+        - to:
+            uri: jms
+            parameters:
+              destinationName: test.queue
diff --git a/camel-1-tribute/metadata.json b/camel-1-tribute/metadata.json
new file mode 100644
index 0000000..da24971
--- /dev/null
+++ b/camel-1-tribute/metadata.json
@@ -0,0 +1,16 @@
+{
+    "title": "Camel 1.0 Tribute",
+    "description": "A tribute to the very first Apache Camel example from 2007 
- JMS to File",
+    "tags": [
+        "beginner",
+        "jms",
+        "file",
+        "artemis",
+        "tribute"
+    ],
+    "bundled": true,
+    "level": "beginner",
+    "infraServices": [
+        "artemis"
+    ]
+}
diff --git a/camel-jbang-example-catalog.json b/camel-jbang-example-catalog.json
index 1d5361f..8ffef5e 100644
--- a/camel-jbang-example-catalog.json
+++ b/camel-jbang-example-catalog.json
@@ -66,6 +66,30 @@
             "http-to-aws-sqs.camel.yaml"
         ]
     },
+    {
+        "name": "camel-1-tribute",
+        "title": "Camel 1.0 Tribute",
+        "description": "A tribute to the very first Apache Camel example from 
2007 - JMS to File",
+        "level": "beginner",
+        "tags": [
+            "beginner",
+            "jms",
+            "file",
+            "artemis",
+            "tribute"
+        ],
+        "bundled": true,
+        "requiresDocker": false,
+        "hasCitrusTests": false,
+        "files": [
+            "README.md",
+            "application.properties",
+            "jms-to-file.camel.yaml"
+        ],
+        "infraServices": [
+            "artemis"
+        ]
+    },
     {
         "name": "circuit-breaker",
         "title": "Circuit Breaker",

Reply via email to