2016-05-12 59 views
3

我試圖將hawtio集成到使用apache駱駝的spring-boot應用程序中。我跟着Spring-Boot Embedded WarsHow to run hawt.io in spring boot application with embedded tomcat加入HawtioConfiguration(除kubeservice和kubepod其不在io.hawt.web包)春季啓動,apache駱駝和hawtio:不能發送消息到端點

所以,這樣的作品,最多的地方,我試圖manualy點發送消息到直接來自hawtio界面的端點(http://localhost:8080/hawtio/index.html#/camel/sendMessage?tab=camel&nid=root-org.apache.camel-camel-1-endpoints-%22direct:%2F%2Fdummy%22)。出現以下警告,並且不發送消息:

Camel does not support sending to this endpoint. 

那麼,我忘記了什麼嗎?這裏是我的設置:springboot 1.3.3.RELEASE具有以下依存關係:

<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> 

和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); 
    } 
} 

謝謝!

編輯:使用hawtio作爲一個獨立的應用程序,連接到springboot工作正常

EDIT2:移動上,我用hawtio作爲另一個項目(同版)一戰,部署在一個Tomcat 7相同的問題,不能發送到一個直接的端點。 去圖。

回答

0

使用hawtio作爲戰爭選項使用彈簧引導和駱駝的應用程序非常好,我已經成功地使用它。 檢查hawtio github上的代碼示例,它包含了很好的樣本,試圖 https://github.com/hawtio/hawtio

此外,我將分享與樣品的使用hawtio笏或作爲Maven插件,在我的github鏈接。

+0

我得到了一個戰爭hawtio網站,並通過'連接'面板連接到彈簧引發產生相同的結果。我可以看到並監視我的路線,但無法發送消息給其中的一個 – jlb

0

我有同樣的問題:我不能使用hawt.io發送到直接端點(或任何其他端點)。也許這是hawt.io中的一個常見的Bug /未實現的功能?

但是,以下是可能的:

  • 複製端點URL
  • 在hawt.io選擇上下文節點
  • 點擊 「操作」
  • 使用方法sendStringBody(java中。 lang.String,java.lang.String)向該端點發送一個字符串
  • 第一個參數是您可以粘貼的端點URI