You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/04/12 15:04:02 UTC

[GitHub] [camel-website] apupier opened a new pull request, #822: Blogpost how to start Camel application with Camel Textual Debugger in

apupier opened a new pull request, #822:
URL: https://github.com/apache/camel-website/pull/822

   VS Code in a single action
   
   Video mentioned to be created, published and link to be provided in the blogpost.
   
   Planned for tomorrow


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-website] apupier commented on pull request #822: Blogpost how to start Camel application with Camel Textual Debugger in

Posted by GitBox <gi...@apache.org>.
apupier commented on PR #822:
URL: https://github.com/apache/camel-website/pull/822#issuecomment-1098763891

   rebased and publication date updated


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-website] github-actions[bot] commented on pull request #822: Blogpost how to start Camel application with Camel Textual Debugger in

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #822:
URL: https://github.com/apache/camel-website/pull/822#issuecomment-1098810005

   🚀 Preview is available at https://pr-822--camel.netlify.app


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-website] github-actions[bot] commented on pull request #822: Blogpost how to start Camel application with Camel Textual Debugger in

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #822:
URL: https://github.com/apache/camel-website/pull/822#issuecomment-1098282815

   🚀 Preview is available at https://pr-822--camel.netlify.app


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-website] apupier commented on pull request #822: Blogpost how to start Camel application with Camel Textual Debugger in

Posted by GitBox <gi...@apache.org>.
apupier commented on PR #822:
URL: https://github.com/apache/camel-website/pull/822#issuecomment-1096884146

   failure of PR is not specific to this PR, occurs also on https://github.com/apache/camel-website/pull/820


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-website] zregvart merged pull request #822: Blogpost how to start Camel application with Camel Textual Debugger in

Posted by GitBox <gi...@apache.org>.
zregvart merged PR #822:
URL: https://github.com/apache/camel-website/pull/822


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-website] apupier commented on a diff in pull request #822: Blogpost how to start Camel application with Camel Textual Debugger in

Posted by GitBox <gi...@apache.org>.
apupier commented on code in PR #822:
URL: https://github.com/apache/camel-website/pull/822#discussion_r848569026


##########
content/blog/2022/04/start-camel-application-with-camel-textual-debug-in-vscode/index.md:
##########
@@ -0,0 +1,129 @@
+---
+title: "Start a Camel Main application with Textual debug for Camel routes in VS Code with a single launch configuration"
+date: 2022-04-13
+authors: [apupier]
+categories: ["Tooling"]
+preview: "Start a Camel Main application with Textual debug for Camel routes in VS Code with a single launch configuration"
+---
+
+Textual debug for Camel routes allows to set breakpoints at Route definition.
+
+The Debug Adapter for Apache Camel latest release 0.1.1 [supports JMX connection](/blog/2022/04/camel-textual-debug-0.1.0/). It opens the possibility to start a Camel application with Camel textual route debugging activated in a single VS Code launch configuration. I thought it would be a five minutes effort but it was a several hours search to configure a not-yet-perfect solution. I hope that sharing the current state will save you few hours! Let's see the different configurations required to achieve it.
+
+# How to configure VS Code
+
+## Minimal Camel version
+
+Check that Camel 3.16+ is used.
+
+## camel-debug on classpath
+
+`camel-debug` must be on the classpath for the debug session. As it should not be used in production, a good way to achieve it is to use a Maven profile, for instance:
+
+```xml
+<profiles>
+        <profile>
+            <id>camel.debug</id>
+            <activation>
+                <property>
+                    <name>camel.debug</name>
+                    <value>true</value>
+                </property>
+            </activation>
+            <dependencies>
+                <dependency>
+                    <groupId>org.apache.camel</groupId>
+                    <artifactId>camel-debug</artifactId>
+                </dependency>
+            </dependencies>
+        </profile>
+    </profiles>
+```
+
+## VS Code task to start application
+
+Next step consist in providing a VS Code task to start the Camel application with `camel-debug` on the classpath by using the `camel.debug` profile mentioned in previous point.
+
+In `.settings/tasks.json` (the file might need to be created), you need to add this kind of task:
+
+```json
+{
+	"version": "2.0.0",
+	"tasks": [
+		{
+			"label": "Run Camel application with debug Profile",
+			"type": "shell",
+			"command": "mvn", // mvn binary of Maven must be available on command-line
+			"args": [
+				"camel:run",
+				"-Pcamel.debug" // This depends on your project. The goal here is to have camel-debug on the classpath.
+			],
+			"problemMatcher": { // Problem matcher is mandatory to avoid a dialog warning on each launch but cannot find a good way to configure it
+				"owner": "camel",
+				"pattern": {
+					"regexp": "^.*$" 				
+				},
+				"severity": "error",	
+				"source": "maven",
+				"background": {
+					"activeOnStart": true,
+					"beginsPattern": "^.*$",
+					"endsPattern": "^.*$"
+				}
+			},
+			"presentation": {
+				"reveal": "always"
+			},
+			"isBackground": true // Must be set as background as the Maven commands doesn't return until the Camel application stops. 
+		}
+		
+	]
+}
+```
+
+## Launch configuration to Attach debugger and start application
+
+The idea here is to provide a Launch configuration which will do both: start the Camel application and attach the Camel debugger.
+
+In `.settings/launch.json` (the file might need to be created), you need to add this kind of configuration:
+
+```json
+{
+	"version": "0.2.0",
+	"configurations": [
+		{
+			"name": "Run with Camel Debugger",
+			"type": "apache.camel",
+			"request": "attach",
+			"preLaunchTask": "Run Camel application with debug Profile" // This must match the label provided as task
+		}
+	]
+}
+```
+
+On slow connection, it might not work the first time as the timeout to connect the debugger will be hit. It is not yet configurable, just relaunch it.
+
+## Run & Debug
+
+Last action is to call the Launch configuration. If you have a single launch configuration, hitting `F5` shoudl work. Otherwise, you can go to the `Run and Debug panel` and then `Run & Debug` the launch configuration that you just configured.
+
+Time to set breakpoints and enjoy!
+
+# Resources
+
+[Here](https://github.com/apupier/camel-examples/tree/Demo-for-blogpost/examples/main) you can see a branch of the Camel Main example with metadata preconfigured for VS Code.
+
+I created a short video to see all of that in action here.

Review Comment:
   to update Video mentioned to be created, published and link to be provided in the blogpost.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-website] davsclaus commented on pull request #822: Blogpost how to start Camel application with Camel Textual Debugger in

Posted by GitBox <gi...@apache.org>.
davsclaus commented on PR #822:
URL: https://github.com/apache/camel-website/pull/822#issuecomment-1097652174

   @zregvart is it something that ring a bell for you about that error Aurelien point to about
   ➤ YN0000: [build:antora  ] [build:antora-perf]       "msg": "Could not locate 'xref:js/camel.js' in contentCatalog",


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org