[CAMEL 21975] Jbang diagram command to visualize camel routes#21534
[CAMEL 21975] Jbang diagram command to visualize camel routes#21534vignesh-manel wants to merge 8 commits intoapache:mainfrom
Conversation
ed37eef to
9e895ac
Compare
|
Thanks for helping with jbang. Can you make this into its own plugin as this should not be in the core. You can look at one of the existing pluigins such as the new validate |
...l-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Diagram.java
Outdated
Show resolved
Hide resolved
...l-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Diagram.java
Outdated
Show resolved
Hide resolved
...l-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Diagram.java
Outdated
Show resolved
Hide resolved
...l-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Diagram.java
Outdated
Show resolved
Hide resolved
...l-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Diagram.java
Outdated
Show resolved
Hide resolved
...l-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Diagram.java
Outdated
Show resolved
Hide resolved
...l-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Diagram.java
Outdated
Show resolved
Hide resolved
orpiske
left a comment
There was a problem hiding this comment.
Nice idea, I'm but I'm under the impression this would be better done as a plugin. Let's see what others think about it ...
1f30326 to
3b606a9
Compare
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
@davsclaus @Croway @orpiske Refactored as plugin, please review |
|
Nice @vignesh-manel , were you able to test everything locally? can you provide some commands and outputs? |
|
there are changes to camel-launcher / camel-jbang run etc - that is of course a bit more worring since this plugin should not break existing behaviour. And what web browsers and OS does this work on ? Is it only google chrome ? |
b0c5839 to
1638a5c
Compare
I tested with the jar locally using below command from camel-launcher directory, it requires a browser executable which is compatible with chromium java -jar target/camel-launcher-4.19.0-SNAPSHOT.jar diagram ../camel-jbang-core/src/test/resources/hello.yaml --output=hello.png --playwright-browser-path="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" if --output is not specified it will open the hawtio console, where the integration can be viewed |
I tried to simplify the changes, right now any chromium based browser is supported, I have tested it only in MacOS |
I think this information would be good to add to the documentation, with that little example so others better can understand how to use this feature |
|
|
||
| === 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: |
There was a problem hiding this comment.
the diagram is a plugin you need to install first via camel plugin add diagram
also I think there is some code where we have a known list of plugins we ship so diagram should be added there also
| 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. |
There was a problem hiding this comment.
A good idea is to add that actual long command you typed to run on your mac, as mac users need to point to that /Content/XXX or whatever inside those apps - so users would maybe struggle if they dont have a real working example to see
|
btw I read on social media about a new zig rewritten browser that was headless for AI agents only - it was much faster to launch and supported playwright. |
5b99040 to
5278320
Compare
Is it this? https://github.com/lightpanda-io/browser |
Description
Added Playwright-based PNG export for camel diagram via hawtio and Jolokia
Target
mainbranch)Tracking
Apache Camel coding standards and style
mvn clean install -DskipTestslocally from root folder and I have committed all auto-generated changes.