camel-tooling / camel-idea-plugin

Apache Camel Intellij IDEA plugin
Apache License 2.0
201 stars 52 forks source link

Breakpoint disabled: Camel EIP ID Not Found #999

Open jhoeflaken opened 3 months ago

jhoeflaken commented 3 months ago

Hi,

I cannot get the debugging to work. As soon as the application starts my breakpoint is disabled with Camel EIP ID not found. Attached my simple application. I use Camel Spring Boot Application configuration. I see the .camel.debugger.pom.xml being created and I get the popup that the Camel debugger was successfully connected.

Camel plugin version: 1.2.5 Spring Boot 3.2.3, Camel 4.4.0, IntelliJ 2023.3.5, Java 21 on WSL2. Same on Windows with Spring Boot 3.2.3/Camel 4.4.0/Java 21 and Spring Boot 3.2.2/Camel 4.3.0/Java 21

image debug-test.zip

jhoeflaken commented 3 months ago

Is there any way I can debug the debugger plugin?

essobedo commented 3 months ago

Yes, you can launch in debug mode the runIde task, for more details refer to https://github.com/camel-tooling/camel-idea-plugin?tab=readme-ov-file#running-and-debugging-the-plugin-from-source

jhoeflaken commented 3 months ago

@essobedo Thnx.

I will take a look.

Kind regards.

Jacob.

jhoeflaken commented 3 months ago

Hi @essobedo ,

I have found that the problem is within CamelDebugerSession#getBreakpointId.

The identified source locations are:

image

And therefore the XPath to locate the proper line in the route:

image

But the routes document against the XPath is evaluated doesn't contain those attributes:

image

Do I need to set a specific setting to add these sourceLocation to a route?

Kind regards,

Jacob

jhoeflaken commented 3 months ago

@essobedo

Seems to work now. Needed to add the following in application.yaml:

camel:
  springboot:
    main-run-controller: true
    source-location-enabled: true

spring:
  jmx:
    enabled: true

The source-location-enabled is false by default.

essobedo commented 3 months ago

The goal of .camel.debugger.pom.xml is to configure everything for you. So I will try to have a look asap, thx for the investigation and reporting the issue

davsclaus commented 3 months ago

Thanks for finding the problem. @essobedo see if you can find out if camel-debug JAR does not automatic enable this in both camel-main / camel-spring-boot and camel-quarkus

turing85 commented 3 months ago

@essobedo if you need a reproducer for camel-quarkus: I updated the reproducer from https://github.com/camel-tooling/camel-idea-plugin/issues/930 to quarkus 3.9.1; it shows the same behaviour.

essobedo commented 3 months ago

Thx for the reproducer, I will try to do it this week as soon as I will have some spare time

turing85 commented 2 months ago

Any progress on this?

essobedo commented 2 months ago

I started to investigate but unfortunately I could not find an easy fix for it and could not find enough time to investigate more. I will try to investigate more this week or next week

davsclaus commented 2 months ago

Did you find time to investigate more - In IDEA 2024.1.1 it seems that setting a breakpoint, cannot set it as a Camel breakpoint (only regular).

davsclaus commented 2 months ago

This will help for XML routes (as they do not have source loc:line) https://issues.apache.org/jira/browse/CAMEL-20757

davsclaus commented 1 month ago

And this https://issues.apache.org/jira/browse/CAMEL-20758

essobedo commented 1 month ago

@davsclaus did you plan to backport those changes into Camel 4.4?

davsclaus commented 1 month ago

Only if we get this to work first with main branch (ie 4.7.0) then we can look at what changes was done and what can be backported.

However the debugger is wonky and does not seem to work so well in IDEA. Not sure if you or anyone else have time to look into this.

I am afraid that this IDEA plugin is community only

davsclaus commented 1 month ago

okay so it seems that the debugger rely on message history being enabled to have some details

davsclaus commented 1 month ago

https://issues.apache.org/jira/browse/CAMEL-20761

davsclaus commented 1 month ago

Okay I can get the example to debug OOTB with some more changes

Screenshot 2024-05-13 at 13 02 59
davsclaus commented 1 month ago

This requires too many code changes and will not make it back to 4.4.x.