Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
638 changes: 346 additions & 292 deletions camel-jbang-example-catalog.json

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
47 changes: 47 additions & 0 deletions eip/aggregator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
## Aggregator

This example demonstrates the Aggregator EIP.

Individual order messages are collected into batches of 5 using the Aggregator EIP.
The `StringAggregationStrategy` joins message bodies with a comma delimiter.

A timer generates one order per second. The aggregator collects 5 orders before
releasing the batch, which is then logged as a single combined message.

### Install JBang

First install JBang according to https://www.jbang.dev

When JBang is installed then you should be able to run from a shell:

```sh
$ jbang --version
```

This will output the version of JBang.

To run this example you can either install Camel on JBang via:

```sh
$ jbang app install camel@apache/camel
```

Which allows to run Camel CLI with `camel` as shown below.

### How to run

You can run this example using:

```sh
$ camel run *
```

### 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!
37 changes: 37 additions & 0 deletions eip/aggregator/aggregator.camel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
- beans:
- name: myAggregationStrategy
type: "#class:org.apache.camel.processor.aggregate.StringAggregationStrategy"
properties:
delimiter: ", "

- route:
id: order-generator
from:
uri: timer
parameters:
timerName: orders
period: 1000
steps:
- setBody:
expression:
simple:
expression: "Order-${exchangeProperty.CamelTimerCounter}"
- log:
message: "New: ${body}"
- to:
uri: direct:aggregate

- route:
id: order-aggregator
from:
uri: direct:aggregate
steps:
- aggregate:
aggregationStrategy: "#bean:myAggregationStrategy"
correlationExpression:
constant:
expression: "true"
completionSize: 5
steps:
- log:
message: "Batch of 5: ${body}"
11 changes: 11 additions & 0 deletions eip/aggregator/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"title": "Aggregator",
"description": "Collect individual messages into a batch using the Aggregator EIP",
"tags": [
"eip",
"aggregator",
"batch"
],
"bundled": true,
"level": "beginner"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
48 changes: 48 additions & 0 deletions eip/content-based-router/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
## Content Based Router

This example demonstrates the Content Based Router EIP.

A simulated temperature sensor generates random readings between 0 and 40.
The route uses the `choice` EIP to classify each reading:

- **Hot** (>= 30): logged as an alert
- **Normal** (15-29): logged as normal
- **Cold** (< 15): logged as an alert

### Install JBang

First install JBang according to https://www.jbang.dev

When JBang is installed then you should be able to run from a shell:

```sh
$ jbang --version
```

This will output the version of JBang.

To run this example you can either install Camel on JBang via:

```sh
$ jbang app install camel@apache/camel
```

Which allows to run Camel CLI with `camel` as shown below.

### How to run

You can run this example using:

```sh
$ camel run *
```

### 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!
45 changes: 45 additions & 0 deletions eip/content-based-router/content-based-router.camel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
- route:
id: sensor
from:
uri: timer
parameters:
timerName: sensor
period: 1000
steps:
- setBody:
expression:
simple:
expression: "${random(0,40)}"
- convertBodyTo:
type: int
- choice:
when:
- simple:
expression: "${body} >= 30"
steps:
- setHeader:
name: level
expression:
constant:
expression: hot
- log:
message: "Hot alert: ${body} C"
- simple:
expression: "${body} >= 15"
steps:
- setHeader:
name: level
expression:
constant:
expression: normal
- log:
message: "Normal: ${body} C"
otherwise:
steps:
- setHeader:
name: level
expression:
constant:
expression: cold
- log:
message: "Cold alert: ${body} C"
11 changes: 11 additions & 0 deletions eip/content-based-router/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"title": "Content Based Router",
"description": "Route messages to different destinations based on message content using the Choice EIP",
"tags": [
"eip",
"choice",
"routing"
],
"bundled": true,
"level": "beginner"
}
47 changes: 47 additions & 0 deletions eip/splitter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
## Splitter

This example demonstrates the Splitter EIP.

A batch of comma-separated product names is split into individual messages.
Each item is logged with its split index.

The splitter processes each part of the message independently, which is useful
for breaking down bulk data into individual records for downstream processing.

### Install JBang

First install JBang according to https://www.jbang.dev

When JBang is installed then you should be able to run from a shell:

```sh
$ jbang --version
```

This will output the version of JBang.

To run this example you can either install Camel on JBang via:

```sh
$ jbang app install camel@apache/camel
```

Which allows to run Camel CLI with `camel` as shown below.

### How to run

You can run this example using:

```sh
$ camel run *
```

### 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!
11 changes: 11 additions & 0 deletions eip/splitter/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"title": "Splitter",
"description": "Split a batch of items into individual messages for processing",
"tags": [
"eip",
"splitter",
"batch"
],
"bundled": true,
"level": "beginner"
}
22 changes: 22 additions & 0 deletions eip/splitter/splitter.camel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
- route:
id: order-splitter
from:
uri: timer
parameters:
timerName: orders
period: 5000
repeatCount: 3
steps:
- setBody:
expression:
constant:
expression: "Laptop,Phone,Tablet,Monitor,Keyboard"
- log:
message: "Received batch: ${body}"
- split:
expression:
tokenize:
token: ","
steps:
- log:
message: "Processing item ${headers.CamelSplitIndex}: ${body}"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 0 additions & 18 deletions openapi/README.md

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading