3

I'm trying to integrate hawtio in a spring-boot application using apache camel. I followed Spring-Boot Embedded Wars and added HawtioConfiguration from How to run hawt.io in spring boot application with embedded tomcat (except for the kubeservice and kubepod which are not in io.hawt.web package)

So, that works, up to the point where I try to manualy send a message to a direct endpoint from the hawtio interface ( http://localhost:8080/hawtio/index.html#/camel/sendMessage?tab=camel&nid=root-org.apache.camel-camel-1-endpoints-%22direct:%2F%2Fdummy%22 ) . The following warning appears, and no message is sent:

Camel does not support sending to this endpoint.

So, did I forget anything ? Here is my set up : springboot 1.3.3.RELEASE with the following dependencies :

    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-spring-boot-starter</artifactId>
        <version>2.17.0</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-jdbc</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-jersey</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-actuator</artifactId>
    </dependency>

    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>io.hawt</groupId>
        <artifactId>hawtio-springboot</artifactId>
        <version>1.4.64</version>
    </dependency>
    <dependency>
        <groupId>io.hawt</groupId>
        <artifactId>hawtio-core</artifactId>
        <version>1.4.64</version>
    </dependency>

and the Application.java :

@SpringBootApplication
@EnableHawtio
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
public class Application {

    @Autowired
    private ServletContext servletContext;

    public static void main(String[] args) {
         System.setProperty(AuthenticationFilter.HAWTIO_AUTHENTICATION_ENABLED, "false");
        SpringApplication.run(Application.class, args);
    }
    @PostConstruct
    public void init() {
        final ConfigManager configManager = new ConfigManager();
        configManager.init();
        servletContext.setAttribute("ConfigManager", configManager);
    }
}

Thanks !

edit: using hawtio as a standalone app and connecting to springboot works fine

edit2: moving on, I used hawtio as a war on another project (same version) , deployed on a tomcat 7. Same issue, cannot send to a direct endpoint. go figure.

Community
  • 1
  • 1
jlb
  • 358
  • 3
  • 15

2 Answers2

0

The option of using hawtio as war works very well with application using spring boot and camel, I am already using it successfully. check the hawtio github code example, it contains good samples to try https://github.com/hawtio/hawtio

Also I will share my github link with sample's of using hawtio wat or as maven plug-in.

rak22
  • 338
  • 4
  • 13
  • I got a war the hawtio website, and connecting to the spring boot via the 'connect' panel yield the same result. I can see and monitor my routes, but cannot send a message to one of them – jlb Jul 06 '16 at 13:09
0

I had the same problem: I could not use hawt.io to send to a direct endpoint (nor any other endpoint). Maybe it is a general Bug/ unimplemented feature in hawt.io?

However, the following was possible:

  • Copy the Endpoint URL
  • Select the context node in hawt.io
  • Click on "Operations"
  • Use the method sendStringBody(java.lang.String,java.lang.String) to send a string to that endpoint
  • First parameter is the endpoint URI that you can paste in
fuemf5
  • 301
  • 3
  • 4