hawtio / hawtio-integration

Core integration plugins for Hawtio: Apache ActiveMQ, Camel, Karaf, OSGi, and Spring Boot
Apache License 2.0
32 stars 27 forks source link

Apache Camel and hawt.io debugging: Body/Header not visible at breakpoint #169

Open Nithinu2018 opened 5 months ago

Nithinu2018 commented 5 months ago

I'm currently working with Apache Camel and hawt.io for monitoring and debugging my Camel routes. This works wonderfully, even if some important information is somewhat hidden in the documentation. For example, it took me a bit to turn on debugging.

However, if I set a breakpoint where the message processing stops at that point in the route, I can't see any "body" or "headers" of my Camel exchange at that point. I've tried all sorts of settings:

Here is some information: Apache Camel: 3.22.1 Spring boot: 2.7.18 Jolokai Core: 1.7.2 hawt.io: 2.16.0 Camel DSL: XML

I got one workaround for java DSL: getContext().setDebugging(true); in one of the page but I don't know where to add this line in camel XML Route Template file.

Here are the properties of my spring boot application.properties: management.endpoints.web.exposure.include=hawtio,jolokia management.endpoints.web.base-path=/ camel.springboot.backlog-tracing=true spring.jmx.enabled=true

Please suggest any workaround for this issue.

tadayosi commented 5 months ago

Hawtio v2 / hawtio-integration is no longer maintained. Please use Hawtio v3 or v4.

For Spring Boot 2.x & Camel 3.x, you can refer to this example: https://github.com/hawtio/hawtio/tree/3.x/examples/springboot

For XML DSL, you should be able to set debugging like this:

<camelContext debug="true" xmlns="http://camel.apache.org/schema/spring">
Nithinu2018 commented 5 months ago

Hawtio v2 / hawtio-integration is no longer maintained. Please use Hawtio v3 or v4.

For Spring Boot 2.x & Camel 3.x, you can refer to this example: https://github.com/hawtio/hawtio/tree/3.x/examples/springboot

For XML DSL, you should be able to set debugging like this:

<camelContext debug="true" xmlns="http://camel.apache.org/schema/spring">

We are not using camelContext in our route files. Instead we are defining routes in RouteTemplate and configuring/invoking those routes via route-builder.xml file.

we tried with <routeTemplates debug="true" xmlns="http://camel.apache.org/schema/spring">, but it is not working.

Content of route file:

<routeTemplates xmlns="http://camel.apache.org/schema/spring">
    <routeTemplate id="myTemplate">
        <templateParameter name="name"/>
        <templateParameter name="greeting"/>
        <templateParameter name="myPeriod" defaultValue="3s"/>
        <route>
            <from uri="timer:{{name}}?period={{myPeriod}}"/>
            <setBody><simple>{{greeting}} ${body}</simple></setBody>
            <log message="${body}"/>
        </route>
    </routeTemplate>
</routeTemplates>

Content of route-builde.xml:

<?xml version="1.0" encoding="UTF-8"?>
<templatedRoutes id="myTemplateRoute"
    backlogTrace="true" debug="true" trace="true">
    <templatedRoute routeId="myTemplate"
            routeTemplateRef="myRouteTemplatee">templatedRoute
    </templatedRoute>
</templatedRoutes>

Could you please provide workaround for this route files to enable debugging.

One more information we require is that "which version of hawtio-core is compatible with below dependency"

<dependency>
    <groupId>io.hawt</groupId>
    <artifactId>hawtio-springboot</artifactId>
    <version>3.0.1</version>
</dependency>

Thanks in advance

tadayosi commented 5 months ago

One more information we require is that "which version of hawtio-core is compatible with below dependency"

It's Hawtio v3, and v3 (and v4) don't use hawtio-core / hawtio-integration any longer. They use @hawtio/react.

Could you please provide workaround for this route files to enable debugging.

For the detailed question on Camel, please ask the Camel users mailing list as here is not the place to help Camel issues. Camel experts should answer you better.