blob: e346294b66a5810975032076e93126100eb7c3d3 [file] [log] [blame]
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> <link rel="apple-touch-icon-precomposed" sizes="57x57" href="../../../../apple-touch-icon-57x57.png"> <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../../../../apple-touch-icon-114x114.png"> <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../../../../apple-touch-icon-72x72.png"> <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../../../../apple-touch-icon-144x144.png"> <link rel="apple-touch-icon-precomposed" sizes="60x60" href="../../../../apple-touch-icon-60x60.png"> <link rel="apple-touch-icon-precomposed" sizes="120x120" href="../../../../apple-touch-icon-120x120.png"> <link rel="apple-touch-icon-precomposed" sizes="76x76" href="../../../../apple-touch-icon-76x76.png"> <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../../../apple-touch-icon-152x152.png"> <link rel="icon" type="image/png" href="../../../../favicon-196x196.png" sizes="196x196"> <link rel="icon" type="image/png" href="../../../../favicon-96x96.png" sizes="96x96"> <link rel="icon" type="image/png" href="../../../../favicon-32x32.png" sizes="32x32"> <link rel="icon" type="image/png" href="../../../../favicon-16x16.png" sizes="16x16"> <link rel="icon" type="image/png" href="../../../../favicon-128.png" sizes="128x128"> <meta name="application-name" content="Apache Camel"> <meta property="og:title" content="How to use Camel textual Route Debugger with Unit test in VS Code - Updated with Camel 3.18"> <meta property="og:site_name" content="Apache Camel"> <meta property="og:url" content="https://camel.apache.org/blog/2022/07/HowToUseCamelRouteTextualDebuggerWithUnitTest/"> <meta name="og:description" content="How to use Camel textual Route Debugger with Unit test in VS Code - Updated with Camel 3.18"> <meta property="og:type" content="website"> <meta property="og:image" content="https://camel.apache.org/_/img/logo-d.svg"> <link rel="manifest" href="../../../../site.webmanifest"> <title>How to use Camel textual Route Debugger with Unit test in VS Code - Updated with Camel 3.18 - Apache Camel</title> <link rel="canonical" href="https://camel.apache.org/blog/2022/07/HowToUseCamelRouteTextualDebuggerWithUnitTest/"> <link rel="stylesheet" href="../../../../_/css/site-2955eb42a8.css"> </head> <body class="article"> <header class="header" aria-label="Header"> <nav class="navbar" aria-label="Main menu"> <div class="navbar-brand"> <a class="nav-logo" href="../../../../" title="Apache Camel"></a> <div id="topbar-nav" class="navbar-menu"> <div class="navbar-end"> <a class="navbar-item-section navbar-item navbar-topics" href="../../../../blog/"> <img alt="Blog" src="../../../../_/img/blog-4c7fa4cb60.svg"> Blog </a> <a class="navbar-item-section navbar-item navbar-topics" href="../../../../docs/"> <img alt="Documentation" src="../../../../_/img/documentation-abb1b7f8b1.svg"> Documentation </a> <a class="navbar-item-section navbar-item navbar-topics" href="../../../../community/"> <img alt="Community" src="../../../../_/img/community-2ec8a3dc8b.svg"> Community </a> <a class="navbar-item-section navbar-item navbar-topics" href="../../../../download/"> <img alt="Download" src="../../../../_/img/download-63cdd75074.svg"> Download </a> <a class="navbar-item-section navbar-item navbar-topics" href="../../../../security/"> <img alt="Security" src="../../../../_/img/security-06abe157b3.svg"> Security </a> </div> </div> <div class="navbar-fill"></div> <div class="break-row"></div> <div class="navbar-search results-hidden"> <input id="search" class="search" placeholder="Search" autocomplete="off"> <img src="/_/img/cancel-1ed239489b.svg" alt="Clear" id="search-cancel"> <div id="search_results"></div> </div> <div class="navbar-tools"> <a rel="noopener noreferrer nofollow" href="https://github.com/apache/camel/" title="Collaborate on GitHub"><svg focusable="false" class="brand-icon"><use href="../../../../_/img/brand-logos-f2e689f4d4.svg#github"/></svg></a> <a rel="noopener noreferrer nofollow" href="https://camel.zulipchat.com" title="Chat on Zulip"><svg focusable="false" class="brand-icon"><use href="../../../../_/img/brand-logos-f2e689f4d4.svg#zulip"/></svg></a> <a rel="noopener noreferrer nofollow" href="https://twitter.com/ApacheCamel" title="Follow Apache Camel on Twitter"><svg focusable="false" class="brand-icon"><use href="../../../../_/img/brand-logos-f2e689f4d4.svg#twitter"/></svg></a> <a rel="noopener noreferrer nofollow" href="https://www.linkedin.com/groups/2447439/" title="Apache Camel group on Linkedin"><svg focusable="false" class="brand-icon"><use href="../../../../_/img/brand-logos-f2e689f4d4.svg#linkedin"/></svg></a> </div> <button class="navbar-burger" data-target="topbar-nav" type="button" aria-label="Menu"> <span></span> <span></span> <span></span> </button> </div> </nav> </header> <a id="top"></a> <div class="body"> <main role="main blog"> <article class="blog doc"> <header aria-labelledby="title"> <a class="category" href="../../../../categories/Tooling/">TOOLING</a> <h1 id="title">How to use Camel textual Route Debugger with Unit test in VS Code - Updated with Camel 3.18</h1> </header> <div class="post"> <aside aria-label="Post details"> <div class="summary">How to use Camel textual Route Debugger with Unit test in VS Code - Updated with Camel 3.18</div> Posted on <time itemprop="published" datetime="2022-07-26" title="Tuesday, July 26, 2022">July 26, 2022</time>, by <figure> <img src="https://avatars.githubusercontent.com/u/1105127?v=4" alt="Aurélien Pupier"> <figcaption rel="author">Aurélien Pupier</figcaption> </figure> <h4>Share this blog</h4> <a class="resp-sharing-button__link" href="https://facebook.com/sharer/sharer.php?u=https%3a%2f%2fcamel.apache.org%2fblog%2f2022%2f07%2fHowToUseCamelRouteTextualDebuggerWithUnitTest%2f" target="_blank" rel="noopener" aria-label="Share on Facebook"> <div class="resp-sharing-button resp-sharing-button--facebook resp-sharing-button--small"><div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" focusable="false"><path d="M18.77 7.46H14.5v-1.9c0-.9.6-1.1 1-1.1h3V.5h-4.33C10.24.5 9.5 3.44 9.5 5.32v2.15h-3v4h3v12h5v-12h3.85l.42-4z"/></svg> </div> </div> </a> <a class="resp-sharing-button__link" href="https://twitter.com/intent/tweet/?text=How%20to%20use%20Camel%20textual%20Route%20Debugger%20with%20Unit%20test%20in%20VS%20Code%20-%20Updated%20with%20Camel%203.18&url=https%3a%2f%2fcamel.apache.org%2fblog%2f2022%2f07%2fHowToUseCamelRouteTextualDebuggerWithUnitTest%2f&hashtags=ApacheCamel" target="_blank" rel="noopener" aria-label="Share on Twitter"> <div class="resp-sharing-button resp-sharing-button--twitter resp-sharing-button--small"><div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" focusable="false"><path d="M23.44 4.83c-.8.37-1.5.38-2.22.02.93-.56.98-.96 1.32-2.02-.88.52-1.86.9-2.9 1.1-.82-.88-2-1.43-3.3-1.43-2.5 0-4.55 2.04-4.55 4.54 0 .36.03.7.1 1.04-3.77-.2-7.12-2-9.36-4.75-.4.67-.6 1.45-.6 2.3 0 1.56.8 2.95 2 3.77-.74-.03-1.44-.23-2.05-.57v.06c0 2.2 1.56 4.03 3.64 4.44-.67.2-1.37.2-2.06.08.58 1.8 2.26 3.12 4.25 3.16C5.78 18.1 3.37 18.74 1 18.46c2 1.3 4.4 2.04 6.97 2.04 8.35 0 12.92-6.92 12.92-12.93 0-.2 0-.4-.02-.6.9-.63 1.96-1.22 2.56-2.14z"/></svg> </div> </div> </a> <a class="resp-sharing-button__link" href="https://www.linkedin.com/shareArticle?mini=true&url=https%3a%2f%2fcamel.apache.org%2fblog%2f2022%2f07%2fHowToUseCamelRouteTextualDebuggerWithUnitTest%2f&title=How%20to%20use%20Camel%20textual%20Route%20Debugger%20with%20Unit%20test%20in%20VS%20Code%20-%20Updated%20with%20Camel%203.18&summary=How%20to%20use%20Camel%20textual%20Route%20Debugger%20with%20Unit%20test%20in%20VS%20Code%20-%20Updated%20with%20Camel%203.18&source=https%3A%2F%2Fcamel.apache.org" target="_blank" rel="noopener" aria-label="Share on LinkedIn" title="Share on LinkedIn"> <div class="resp-sharing-button resp-sharing-button--linkedin resp-sharing-button--small"><div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" focusable="false"><path d="M6.5 21.5h-5v-13h5v13zM4 6.5C2.5 6.5 1.5 5.3 1.5 4s1-2.4 2.5-2.4c1.6 0 2.5 1 2.6 2.5 0 1.4-1 2.5-2.6 2.5zm11.5 6c-1 0-2 1-2 2v7h-5v-13h5V10s1.6-1.5 4-1.5c3 0 5 2.2 5 6.3v6.7h-5v-7c0-1-1-2-2-2z"/></svg> </div> </div> </a> <p> <a class="arrow prev" href="../../../../blog/2022/07/secrets-properties-functions-part-2/" title="Previous post: Load properties from Vault/Secrets cloud services: an update">&#10094;</a> <a class="arrow next" href="../../../../blog/2022/07/ApacheCons/" title="Next post: ApacheCon North America &amp; ApacheCon Asia 2022">&#10095;</a> </p> </aside> <div class="post-content"> <p>Textual debug for Camel routes allows to set breakpoints at Route definition. It is convenient to leverage this feature with a Unit test.</p> <p>Last month, I published a <a href="../../../../blog/2022/06/HowToUseCamelRouteTextualDebuggerWithUnitTest">blogpost</a> but it had several limitations listed. Most of them have been fixed. This article is an updated version that will explain how it is possible to configure the project and the VS Code IDE for that. Similar functionality should be possible with other IDEs but not covered in this article.</p> <p>Note: If you prefer to watch than read, you can go to <a href="https://youtu.be/_hKIg81WJUs" rel="noopener nofollow noreferrer">this video</a>.</p> <h1 id="requirements">Requirements</h1> <p>In this article, we will focus on using the <a href="https://code.visualstudio.com/" rel="noopener nofollow noreferrer">VS Code IDE</a>. It implies the following requirements:</p> <ul> <li><a href="https://github.com/camel-tooling/camel-dap-client-vscode/issues" rel="noopener nofollow noreferrer">VS Code client for Debug Adapter for Camel</a> installed in your VS Code instance</li> <li><a href="https://maven.apache.org/" rel="noopener nofollow noreferrer">Maven</a> available on system path</li> <li>Java 11+ installed</li> <li>Camel 3.18+</li> </ul> <h1 id="project-configuration">Project configuration</h1> <h2 id="pom-file-configuration">Pom file configuration</h2> <p><code>camel-debug</code> must be on the classpath. One way to achieve that is to provide the dependency in a profile which needs to be activated when the tests are launched.</p> <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-xml" data-lang="xml"><span class="line"><span class="cl"><span class="nt">&lt;profiles&gt;</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&lt;profile&gt;</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&lt;id&gt;</span>camel.debug<span class="nt">&lt;/id&gt;</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&lt;activation&gt;</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&lt;property&gt;</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&lt;name&gt;</span>camel.debug<span class="nt">&lt;/name&gt;</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&lt;value&gt;</span>true<span class="nt">&lt;/value&gt;</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&lt;/property&gt;</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&lt;/activation&gt;</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&lt;dependencies&gt;</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&lt;dependency&gt;</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&lt;groupId&gt;</span>org.apache.camel<span class="nt">&lt;/groupId&gt;</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&lt;artifactId&gt;</span>camel-debug<span class="nt">&lt;/artifactId&gt;</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&lt;/dependency&gt;</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&lt;/dependencies&gt;</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&lt;/profile&gt;</span>
</span></span><span class="line"><span class="cl"><span class="nt">&lt;/profiles&gt;</span>
</span></span></code></pre></div><h2 id="test-class-configuration">Test class configuration</h2> <p>You might need to provide a longer timeout to let you time to debug, something like:</p> <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="kd">class</span> <span class="nc">MainTest</span><span class="w"> </span><span class="kd">extends</span><span class="w"> </span><span class="n">CamelMainTestSupport</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nd">@Test</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="kt">void</span><span class="w"> </span><span class="nf">myTest</span><span class="p">()</span><span class="w"> </span><span class="kd">throws</span><span class="w"> </span><span class="n">Exception</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="n">NotifyBuilder</span><span class="w"> </span><span class="n">notify</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">new</span><span class="w"> </span><span class="n">NotifyBuilder</span><span class="p">(</span><span class="n">context</span><span class="p">)</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="p">.</span><span class="na">whenCompleted</span><span class="p">(</span><span class="n">1</span><span class="p">).</span><span class="na">whenBodiesDone</span><span class="p">(</span><span class="s">&#34;Bye World&#34;</span><span class="p">).</span><span class="na">create</span><span class="p">();</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="n">assertTrue</span><span class="p">(</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="n">notify</span><span class="p">.</span><span class="na">matches</span><span class="p">(</span><span class="n">90</span><span class="p">,</span><span class="w"> </span><span class="n">TimeUnit</span><span class="p">.</span><span class="na">SECONDS</span><span class="p">),</span><span class="w"> </span><span class="s">&#34;1 message should be completed&#34;</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="p">);</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="p">}</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="p">}</span><span class="w">
</span></span></span></code></pre></div><h1 id="ide-configuration">IDE configuration</h1> <h2 id="vs-code-task-configuration">VS Code Task configuration</h2> <p>A VS Code task must be created in the <code>.vscode/tasks.json</code> file to start the test with correct settings. You can use the snippet available on completion. It will create something like:</p> <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&#34;version&#34;</span><span class="p">:</span> <span class="s2">&#34;2.0.0&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&#34;tasks&#34;</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl"> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&#34;label&#34;</span><span class="p">:</span> <span class="s2">&#34;Launch Camel test with Maven with camel.debug profile&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&#34;type&#34;</span><span class="p">:</span> <span class="s2">&#34;shell&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&#34;command&#34;</span><span class="p">:</span> <span class="s2">&#34;mvn&#34;</span><span class="p">,</span> <span class="c1">// mvn binary of Maven must be available on command-line
</span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="nt">&#34;args&#34;</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl"> <span class="s2">&#34;test&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">&#34;-Dtest=*&#34;</span><span class="p">,</span> <span class="c1">// If more than one test is present, a specific one must be specified as a single test can be Camel debugged per launch.
</span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="s2">&#34;-Pcamel.debug&#34;</span> <span class="c1">// This depends on your project. The goal here is to have camel-debug on the classpath.
</span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="p">],</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&#34;options&#34;</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&#34;env&#34;</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&#34;CAMEL_DEBUGGER_SUSPEND&#34;</span><span class="p">:</span> <span class="s2">&#34;true&#34;</span> <span class="c1">// Set to true by default. A debugger must be attached for message to be processed.
</span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="p">}</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&#34;problemMatcher&#34;</span><span class="p">:</span> <span class="s2">&#34;$camel.debug.problemMatcher&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&#34;presentation&#34;</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&#34;reveal&#34;</span><span class="p">:</span> <span class="s2">&#34;always&#34;</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&#34;isBackground&#34;</span><span class="p">:</span> <span class="kc">true</span> <span class="c1">// Must be set as background as the Maven commands doesn&#39;t return until the Camel application stops.
</span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="p">}</span>
</span></span><span class="line"><span class="cl"> <span class="p">]</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre></div><h2 id="vs-code-launch-configuration">VS Code Launch configuration</h2> <p>A launch configuration must be created in the <code>.vscode/launch.json</code>. It allows to call the VS Code tasks starting the test and attach debugger when the Camel debugger is ready. A snippet completiion is available to guide to create it. You will end up with something like:</p> <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&#34;version&#34;</span><span class="p">:</span> <span class="s2">&#34;0.2.0&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&#34;configurations&#34;</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl"> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&#34;name&#34;</span><span class="p">:</span> <span class="s2">&#34;Start test and attach Camel Debugger&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&#34;type&#34;</span><span class="p">:</span> <span class="s2">&#34;apache.camel&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&#34;request&#34;</span><span class="p">:</span> <span class="s2">&#34;attach&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&#34;preLaunchTask&#34;</span><span class="p">:</span> <span class="s2">&#34;Launch Camel test with Maven with camel.debug profile&#34;</span> <span class="c1">// must reference the label of the VS Code task previously created
</span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="p">}</span>
</span></span><span class="line"><span class="cl"> <span class="p">]</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre></div><h1 id="run--debug">Run &amp; Debug</h1> <p>Place the breakpoint on your Camel Route <em>before</em> launching the test.</p> <p>Then you can launch the test with Camel debugger which will be automatically attached. It is now time to enjoy your debug session!</p> <h1 id="resources">Resources</h1> <p>See the full configuration steps in <a href="https://youtu.be/_hKIg81WJUs" rel="noopener nofollow noreferrer">this video</a>.</p> <p>You can see an adapted official example with checked-in VS Code settings <a href="https://github.com/apupier/camel-examples/tree/demo-blogpost-test-v2/examples/main" rel="noopener nofollow noreferrer">here</a>.</p> <h1 id="limitations">Limitations</h1> <p>We have seen one way to debug a Camel route textually which is part of a test. You might have noticed that it remains one important limitations which is that we can launch a single test at a time.</p> <h1 id="whats-next">What&rsquo;s next</h1> <p>You can submit your enhancement requests on the <a href="https://github.com/camel-tooling/camel-dap-client-vscode/issues" rel="noopener nofollow noreferrer">VS Code client for Debug Adapter for Camel</a> or in the <a href="https://issues.redhat.com/browse/FUSETOOLS2" rel="noopener nofollow noreferrer">Red Hat Jira</a>. Feel free to upvote or comment existing ones too and to provide Pull Requests if you are interested.</p> <div class="related"> <h3 id="related"><a class="anchor" href="#related"></a>Related posts</h3> <article class="blog doc"> <header aria-label="Blog post"> <a href="../../../../blog/2022/06/HowToUseCamelRouteTextualDebuggerWithUnitTest/"><h1>How to use Camel textual Route Debugger with Unit test in VS Code</h1></a> <time itemprop="published" datetime="2022-06-22" title="Wednesday, June 22, 2022">June 22, 2022</time>, by <span rel="author">Aurélien Pupier</span> </header> <p>EDIT: I recommend to read this new article if using Camel 3.18+. Textual debug for Camel routes allows to set breakpoints at Route definition. It is convenient to leverage this feature with a Unit test. This article will explain how it is possible to configure the project and the VS Code IDE for that. Similar functionality should be possible with other IDEs but not covered in this article. Requirements In this article, we will focus on using VS Code IDE.</p> <p><a class="continue" href="../../../../blog/2022/06/HowToUseCamelRouteTextualDebuggerWithUnitTest/">Continue reading &#10095;</a></p> <p> <a class="category" href="../../../../categories/Tooling/">TOOLING</a> </p> </article> <article class="blog doc"> <header aria-label="Blog post"> <a href="../../../../blog/2022/05/release-vscode-debug-adapter-0.3.0/"><h1>New release of VS Code Debug Adapter for Apache Camel 0.3.0</h1></a> <time itemprop="published" datetime="2022-05-17" title="Tuesday, May 17, 2022">May 17, 2022</time>, by <span rel="author">Aurélien Pupier</span> </header> <p>Textual debug for Camel routes allows to set breakpoints at Route definition. The new release of VS Code Debug Adapter for Apache Camel 0.3.0 improves guidance to start the debug session and provide support for conditional breakpoint. Guidance to start the debug session improvements Codelens and contextual menu In previous release, the command Start camel Application with JBang and debug was provided in the command palette. This command is now also available closer in the User UI.</p> <p><a class="continue" href="../../../../blog/2022/05/release-vscode-debug-adapter-0.3.0/">Continue reading &#10095;</a></p> <p> <a class="category" href="../../../../categories/Tooling/">TOOLING</a><a class="category" href="../../../../categories/Releases/">RELEASES</a> </p> </article> <article class="blog doc"> <header aria-label="Blog post"> <a href="../../../../blog/2022/05/start-camel-quarkus-application-with-camel-textual-debug-in-vscode/"><h1>How to start a Camel Quarkus application with Textual debug for Camel routes in VS Code with a single launch configuration</h1></a> <time itemprop="published" datetime="2022-05-06" title="Friday, May 6, 2022">May 6, 2022</time>, by <span rel="author">Aurélien Pupier</span> </header> <p>Textual debug for Camel routes allows to set breakpoints at Route definition. I previously blogged how to use Camel Route textual debugger targeting Camel Main or Camel JBang. In this blogpost, I will describe the process for a Camel Quarkus application. I&rsquo;m using VS Code as example but similar pattern is possible in other IDEs. Please note that it is working only with Quarkus in JVM mode and not Native mode.</p> <p><a class="continue" href="../../../../blog/2022/05/start-camel-quarkus-application-with-camel-textual-debug-in-vscode/">Continue reading &#10095;</a></p> <p> <a class="category" href="../../../../categories/Tooling/">TOOLING</a> </p> </article> <article class="blog doc"> <header aria-label="Blog post"> <a href="../../../../blog/2022/05/vscode-extension-release-debug-0.2.0/"><h1>New release of VS Code Debug Adapter for Apache Camel 0.2.0</h1></a> <time itemprop="published" datetime="2022-05-04" title="Wednesday, May 4, 2022">May 4, 2022</time>, by <span rel="author">Aurélien Pupier</span> </header> <p>Textual debug for Camel routes allows to set breakpoints at Route definition. The new release of VS Code Debug Adapter for Apache Camel 0.2.0 improves guidance to start the debug session and provide a JBang-based command to start Camel application and attach Camel Textual debugger in a single action. Command to start with Jbang and Camel debug The command Start camel Application with JBang and debug allows a straightforward &ldquo;start and debug&rdquo; with a single action for simple cases.</p> <p><a class="continue" href="../../../../blog/2022/05/vscode-extension-release-debug-0.2.0/">Continue reading &#10095;</a></p> <p> <a class="category" href="../../../../categories/Tooling/">TOOLING</a><a class="category" href="../../../../categories/Releases/">RELEASES</a> </p> </article> <article class="blog doc"> <header aria-label="Blog post"> <a href="../../../../blog/2022/05/vscode-extensions-release-language-0.3.0/"><h1>New release of VS Code Language support for Apache Camel 0.3.0</h1></a> <time itemprop="published" datetime="2022-05-03" title="Tuesday, May 3, 2022">May 3, 2022</time>, by <span rel="author">Aurélien Pupier</span> </header> <p>Release 0.3.0 This new release contains the following upgrades: Camel Quarkus Catalog from 2.7.0 to 2.8.0 Default Camel Catalog version from 3.15.0 to 3.16.0 Kamelet Catalog from 0.7.1 to 0.8.0 What&rsquo;s next You can submit your enhancement requests on the VS Code Language support for Apache Camel or in the Red Hat Jira.</p> <p><a class="continue" href="../../../../blog/2022/05/vscode-extensions-release-language-0.3.0/">Continue reading &#10095;</a></p> <p> <a class="category" href="../../../../categories/Tooling/">TOOLING</a><a class="category" href="../../../../categories/Releases/">RELEASES</a> </p> </article> </div> </div> </div> </article> </main> </div> <div class="footer-tools"> <a title="Improve this document, receive free virtual hugs &hearts;" href="https://github.com/apache/camel-website/edit/main/content/blog/2022/07/HowToUseCamelRouteTextualDebuggerWithUnitTest/index.md">Edit this Page</a> <a href="#top" title="Reach the top of the page">Back to top</a> </div> <footer> <div class="footer"> <figure class="logo"> <img class="logo" src="../../../../_/img/logo-d-a567cee6fa.svg" alt="Apache Camel Logo" aria-label="white silhouette of a camel in front of a sand dune"> </figure> <input id="footer-toggle-overview" type="checkbox" title="Show/Hide Overview section"> <dl> <dt><label for="footer-toggle-overview">Overview</label><label for="footer-toggle-overview">&#65291;</label></dt> <dd><a href="../../../../blog/">Blog</a></dd> <dd><a href="../../../../docs/">Documentation</a></dd> <dd><a href="../../../../community/support/">Community</a></dd> <dd><a href="../../../../download/">Download</a></dd> </dl> <input id="footer-toggle-documentation" type="checkbox" title="Show/Hide Documentation section"> <dl> <dt><label for="footer-toggle-documentation">Documentation</label><label for="footer-toggle-documentation">&#65291;</label></dt> <dd><a href="../../../../manual/">User Manual</a></dd> <dd><a href="../../../../components/next/index.html">Components</a></dd> <dd><a href="../../../../camel-k/next/">Camel-K</a></dd> <dd><a href="../../../../camel-kafka-connector/next/">Camel Kafka Connector</a></dd> <dd><a href="../../../../camel-quarkus/next/">Camel Quarkus</a></dd> <dd><a href="../../../../camel-spring-boot/next/">Camel Spring Boot</a></dd> <dd><a href="../../../../camel-karaf/3.22.x/">Camel Karaf</a></dd> <dd><a href="../../../../manual/faq/index.html">FAQ</a></dd> </dl> <input id="footer-toggle-community" type="checkbox" title="Show/Hide Community section"> <dl> <dt><label for="footer-toggle-community">Community</label><label for="footer-toggle-community">&#65291;</label></dt> <dd><a href="../../../../community/support/">Support</a></dd> <dd><a href="../../../../community/contributing/">Contributing</a></dd> <dd><a href="../../../../community/mailing-list">Mailing Lists</a></dd> <dd><a href="../../../../community/user-stories/">User stories</a></dd> <dd><a href="../../../../community/articles/">Articles</a></dd> <dd><a href="../../../../community/books/">Books</a></dd> <dd><a href="../../../../community/team/">Team</a></dd> </dl> <input id="footer-toggle-about" type="checkbox" title="Show/Hide Acknowledgements section"> <dl> <dt><label for="footer-toggle-about">About</label><label for="footer-toggle-about">&#65291;</label></dt> <dd><a href="../../../../acknowledgments/">Acknowledgments</a></dd> <dd><a target="_blank" rel="noopener noreferrer nofollow" href="https://www.apache.org/events/current-event.html" title="Apache Events">Apache Events</a></dd> <dd><a target="_blank" rel="noopener noreferrer nofollow" href="https://www.apache.org/licenses/" title="License">License</a></dd> <dd><a target="_blank" rel="noopener noreferrer nofollow" href="https://www.apache.org/security/" title="Security">Security</a></dd> <dd><a target="_blank" rel="noopener noreferrer nofollow" href="https://www.apache.org/foundation/sponsorship.html" title="Sponsorship">Sponsorship</a></dd> <dd><a target="_blank" rel="noopener noreferrer nofollow" href="https://www.apache.org/foundation/thanks.html" title="Thanks">Thanks</a></dd> </dl> <p class="remark"> &copy; 2004-2025 The <a href="https://apache.org">Apache Software Foundation</a>.<br> Apache Camel, Camel, Apache, the Apache feather logo, and the Apache Camel project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners. </p> <div class="resources"> <div class="context"> <a href="https://privacy.apache.org/policies/privacy-policy-public.html">Privacy Policy</a> </div> <div class="context"> <a target="_blank" rel="noopener noreferrer nofollow" href="https://www.apache.org/foundation/policies/conduct">Code of Conduct</a> </div> <div class="context"> <a href="../../../../sitemap/">Sitemap</a> </div> </div> <div class="footer-icons"> <a rel="noopener noreferrer nofollow" href="https://github.com/apache/camel/" title="Collaborate on GitHub"><svg class="brand-icon" focusable="false"><use href="../../../../_/img/brand-logos-f2e689f4d4.svg#github"/></svg></a> <a rel="noopener noreferrer nofollow" href="https://camel.zulipchat.com" title="Chat on Zulip"><svg class="brand-icon" focusable="false"><use href="../../../../_/img/brand-logos-f2e689f4d4.svg#zulip"/></svg></a> <a rel="noopener noreferrer nofollow" href="https://twitter.com/ApacheCamel" title="Follow Apache Camel on Twitter"><svg class="brand-icon" focusable="false"><use href="../../../../_/img/brand-logos-f2e689f4d4.svg#twitter"/></svg></a> <a rel="noopener noreferrer nofollow" href="https://www.linkedin.com/groups/2447439/" title="Apache Camel group on Linkedin"><svg class="brand-icon" focusable="false"><use href="../../../../_/img/brand-logos-f2e689f4d4.svg#linkedin"/></svg></a> </div> </div> </footer> <script src="../../../../_/js/vendor/algoliasearch-bad45193e2.js"></script> <script src="../../../../_/js/site-c215fb6972.js"></script> <script async src="../../../../_/js/vendor/highlight-621a10fe1b.js"></script> <script async src="../../../../_/js/vendor/svg4everybody-a0c573f2b9.js"></script> <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "Organization", "name": "Apache Camel", "url": "https:\/\/camel.apache.org\/" , "sameAs": ["https://twitter.com/ApacheCamel"] , "logo": "https:\/\/camel.apache.org\/_\/img\/logo-d.svg" , "description": "Apache Camel ™ is a versatile open-source integration framework based on known Enterprise Integration Patterns. Camel empowers you to define routing and mediation rules in a variety of domain-specific languages, including a Java-based Fluent API, Spring or Blueprint XML Configuration files, and a Scala DSL." } </script> <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "BreadcrumbList", "itemListElement": [{ "@type": "ListItem", "position": 1 , "item": { "@id": "https://camel.apache.org/", "name": "Apache Camel" } },{ "@type": "ListItem", "position": 2 , "item": { "@id": "https://camel.apache.org/blog/", "name": "blog" } },{ "@type": "ListItem", "position": 3 , "item": { "@id": "https://camel.apache.org/blog/2022/", "name": "2022" } },{ "@type": "ListItem", "position": 4 , "item": { "@id": "https://camel.apache.org/blog/2022/07/", "name": "07" } },{ "@type": "ListItem", "position": 5 , "item": { "@id": "https://camel.apache.org/blog/2022/07/HowToUseCamelRouteTextualDebuggerWithUnitTest/", "name": "HowToUseCamelRouteTextualDebuggerWithUnitTest" } }] } </script> </body> </html>