Skip to content

Commit

Permalink
Add camel-k example
Browse files Browse the repository at this point in the history
  • Loading branch information
tadayosi committed Nov 23, 2023
1 parent 7eb5ff2 commit b1bd32d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ This repository provides a collection of examples that demonstrate how you can m
| ------- | ----------- |
| [Camel Quarkus](./camel-quarkus/) | A simple Camel Quarkus application example. |
| [Camel Spring Boot](./camel-springboot/) | A simple Camel Spring Boot application example. |
| [Camel K](./camel-k/) | A simple Camel K integration example. |
9 changes: 9 additions & 0 deletions camel-k/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Camel K Example

[Camel K](https://camel.apache.org/camel-k/2.1.x/index.html) is _hawtio-ready_ by default.

All you need to make it _hawtio-enabled_ is to turn on [Jolokia trait](https://camel.apache.org/camel-k/2.1.x/traits/jolokia.html) for a Camel K integration.

```console
kamel run hello.java -t jolokia.enabled=true --name hawtio-online-example-camel-k
```
14 changes: 14 additions & 0 deletions camel-k/hello.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// camel-k: language=java

import org.apache.camel.builder.RouteBuilder;

public class hello extends RouteBuilder {

@Override
public void configure() throws Exception {
from("timer:java?period={{time:1000}}")
.setBody()
.simple("Hello Camel from ${routeId}")
.log("${body}");
}
}

0 comments on commit b1bd32d

Please sign in to comment.