Skip to content
Draft
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
28 changes: 28 additions & 0 deletions docs/user-manual/modules/ROOT/pages/camel-jbang.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2429,6 +2429,34 @@ then Camel will attempt to uninstall the Jolokia JVM Agent. However, this may no
able to do this always, because the JVM is being terminated which can prevent camel-jbang
from doing JVM process communication to the running Camel integration.

=== Visualizing routes with diagram

The `camel diagram` command uses Hawtio to visualize Camel routes. You can run route files in the background and open Hawtio in a browser:

[source,bash]
----
camel diagram routes.yaml
----

To attach to an existing integration:

[source,bash]
----
camel diagram --name my-integration
----

By default Camel JBang stops the background integration when you exit Hawtio; use `--keep-running` to leave it running.

You can export a PNG snapshot using Playwright (requires a Chromium browser binary and executable path configured):

[source,bash]
----
camel diagram routes.yaml --output=routes.png --playwright-browser-path=/path/to/chrome
----

When using `--output`, Hawtio runs headless and the PNG is captured automatically.
NOTE: PNG export currently supports Chromium only. Use `PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH` or `--playwright-browser-path`.

=== Scripting from terminal using pipes

You can also execute a Camel JBang file as a script that can be used for terminal scripting with pipes and filters.
Expand Down
5 changes: 5 additions & 0 deletions dsl/camel-jbang/camel-jbang-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@
<artifactId>ascii-table</artifactId>
<version>${ascii-table-version}</version>
</dependency>
<dependency>
<groupId>com.microsoft.playwright</groupId>
<artifactId>playwright</artifactId>
<version>${playwright-version}</version>
</dependency>

<!-- jolokia -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ public static void run(CamelJBangMain main, String... args) {
.addSubcommand("transformer", new CommandLine(new ListTransformer(main)))
.addSubcommand("variable", new CommandLine(new ListVariable(main)))
.addSubcommand("vault", new CommandLine(new ListVault(main))))
.addSubcommand("diagram", new CommandLine(new Diagram(main)))
.addSubcommand("hawtio", new CommandLine(new Hawtio(main)))
.addSubcommand("infra", new CommandLine(new InfraCommand(main))
.addSubcommand("get", new CommandLine(new InfraGet(main)))
Expand Down
Loading
Loading