-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kamelet using Java DSL #2117
Comments
The route template part (i.e. the part that can use the property placeholders) in each Kamelet is a YAML flow, but a Kamelet can also hand-off processing to routes written in any of the other supported languages. E.g. apiVersion: camel.apache.org/v1alpha1
kind: Kamelet
metadata:
name: java
labels:
camel.apache.org/kamelet.type: "source"
spec:
sources:
- content: |
// camel-k: language=java
import org.apache.camel.builder.RouteBuilder;
public class Source extends RouteBuilder {
@Override
public void configure() throws Exception {
from("direct:java")
.setBody().exchangeProperty("prop1")
.log("Prop is ${body}");
}
}
name: Source.java
definition:
title: "Example of Kamelet with Java"
description: "Passes data to Java"
properties:
prop1:
title: Property 1
description: A property
type: string
default: "The value"
flow:
# The template is always YAML, but it can pass work to Java
from:
uri: timer:tick
steps:
- set-property:
name: "prop1"
constant: "{{prop1}}"
- to: "direct:java"
- to: "kamelet:sink"
|
thanks @nicolaferraro! Is there somewhere we could add this sample to? |
There's a new developer's guide for Kamelets, maybe we can it as annex |
This issue has been automatically marked as stale due to 90 days of inactivity. |
The Kamelet page outlines various examples with YAML DSL, but all of the integrations I have been writing as using the Java DSL.
The page says:
So is there a way to write a Kamelet that uses the Java DSL?
The text was updated successfully, but these errors were encountered: