Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tadayosi/icamel
A Jupyter kernel for Apache Camel routes
https://github.com/tadayosi/icamel
Last synced: 3 months ago
JSON representation
A Jupyter kernel for Apache Camel routes
- Host: GitHub
- URL: https://github.com/tadayosi/icamel
- Owner: tadayosi
- License: apache-2.0
- Created: 2020-04-22T02:33:12.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-29T07:00:58.000Z (over 3 years ago)
- Last Synced: 2024-10-04T04:58:47.177Z (3 months ago)
- Language: Java
- Homepage: https://github.com/tadayosi/icamel
- Size: 205 KB
- Stars: 6
- Watchers: 4
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ICamel — Jupyter kernel for Apache Camel
This kernel enables you to run [Apache Camel](https://camel.apache.org/) routes in Jupyter notebooks.
![ICamel notebook](docs/img/icamel.png)
## Table of Contents
* [Prerequisites](#prerequisites)
* [Supported Camel route languages](#supported-camel-route-languages)
* [Supported Camel components](#supported-camel-components)
* [Installing](#installing)
* [Build from source](#build-from-source)## Prerequisites
- [Jupyter](https://jupyter.org/install)
- Java >= 11## Supported Camel route languages
All [route languages](https://camel.apache.org/camel-k/latest/languages/languages.html) supported by [Camel K](https://camel.apache.org/camel-k/latest/index.html) except Kotlin are supported by ICamel. See the following links to learn how to write a Camel route with each language.
- [Groovy](https://camel.apache.org/camel-k/latest/languages/groovy.html)
- [JavaScript](https://camel.apache.org/camel-k/latest/languages/javascript.html)
- [Java](https://camel.apache.org/camel-k/latest/languages/java.html)
- [XML](https://camel.apache.org/camel-k/latest/languages/xml.html)
- [YAML](https://camel.apache.org/camel-k/latest/languages/yaml.html)The opinionated default language for ICamel is JavaScript. To use other languages than JavaScript or XML, prepend a comment line `// language=...` at the beginning of each cell.
- Groovy
```groovy
// language=groovy
from('timer:tick')
.process { it.in.body = 'Hello Camel K!' }
.to('log:info')
```
- Java
```java
// language=java
import org.apache.camel.builder.RouteBuilder;
public class Sample extends RouteBuilder {
@Override
public void configure() throws Exception {
from("timer:tick")
.setBody()
.constant("Hello Camel K!")
.to("log:info");
}
}
```- YAML
```yaml
- from:
uri: "timer:tick"
steps:
- set-body:
constant: "Hello Camel K!"
- to: "log:info"
```## Supported Camel components
At this moment, only components that are included in `camel-core` are supported. Automatic downloading of Camel component dependencies will be implemented in a future version.
## Installing
Download the latest `icamel-0.x-runner.jar` from https://github.com/tadayosi/icamel/releases.
```console
curl -LO https://github.com/tadayosi/icamel/releases/download/icamel-0.4.0/icamel-0.4.0-runner.jar
```Then create a directory `camel` under the Jupyter kernels directory:
mkdir -p `jupyter --data-dir`/kernels/camel
and copy `icamel-0.x-runner.jar` into the directory:
cp icamel-0.x-runner.jar `jupyter --data-dir`/kernels/camel/
Finally, create a file `kernel.json` with the following content under the `camel` kernel directory. Note `` needs to be substituted with the actual path (e.g. `/home//.local/share/jupyter/kernels/camel`):
```json
{
"argv": [
"java",
"-jar",
"/icamel-0.x-runner.jar",
"{connection_file}"
],
"display_name": "Camel",
"language": "camel",
"interrupt_mode": "message",
"env": {
}
}
```See the example JSON file [kernel.json](./kernel.json) for more configuration options.
## Build from source
Run the following command:
mvn clean install