Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hawtio unable to detect Camel routes when added via a JAR. #3391

Open
HARSHITHARSH opened this issue Apr 10, 2024 · 5 comments
Open

Hawtio unable to detect Camel routes when added via a JAR. #3391

HARSHITHARSH opened this issue Apr 10, 2024 · 5 comments

Comments

@HARSHITHARSH
Copy link

I am integrating hawtio with our spring boot app (3.2.2) with Camel 4.4.0, and we are importing a JAR in the app that also has camel routes in it, although all the routes are starting properly, in hawtio console I see a blank screen.

Removing the JAR the hawtio screen shows the routes.
To sum up:

For Example

  1. If APP has 2 routes(without JAR import) : Two routes are shown in hawtio console
  2. If APP has 2 routes & JAR has 2 routes : None of the routes are shown in hawtio console
@tadayosi
Copy link
Member

Hi @HARSHITHARSH, thanks for the reporting.

I tested the same setup at my end, but couldn't reproduce the issue. Hawtio works just fine with 2 app routes & 1 route from an external jar.

I used the following route in a jar:

package com.example.hello;

import org.apache.camel.builder.RouteBuilder;
import org.springframework.stereotype.Component;

@Component
public class Hello extends RouteBuilder {

    @Override
    public void configure() throws Exception {

        // Write your routes here, for example:
        from("timer:java?period={{time:1000}}")
            .setBody()
                .simple("Hello Camel from ${routeId}")
            .log("${body}");
    }
}

then using the example project springboot imported the above project com.example:hello:1.0.0 and loaded the component from the startup application as follows:

@SpringBootApplication(scanBasePackages = {"io.hawt.example.spring.boot", "com.example"})
public class SampleSpringBootService {

So, maybe it's related to the way you build the jar and import it into the main app. Can you provide us with a reproducer?

@HARSHITHARSH
Copy link
Author

Can we try with spring dsl routes in both application and jar.

@tadayosi
Copy link
Member

tadayosi commented May 10, 2024

@HARSHITHARSH What does "spring dsl routes" mean? Does it mean Spring XML DSL routes?

@HARSHITHARSH
Copy link
Author

Yes sir.

@tadayosi
Copy link
Member

tadayosi commented May 15, 2024

@HARSHITHARSH Tried Spring XML DSL but nothing has changed. It works.

I suspect it's related to the way you've made the JAR. Can you show us the output of the following command?

$ jar -tf <name-of-the-jar>.jar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

2 participants