2016-06-09 10 views
1

Gary Russels's Monitoring Spring Integration 응용 프로그램이 훌륭합니다.MBeans가 jvisualVM에 표시되지 않습니다.

간단한 MBean을 추가하여 응용 프로그램을 모니터링하고 싶습니다.

package com.example; 

import org.springframework.jmx.export.annotation.ManagedOperation; 
import org.springframework.jmx.export.annotation.ManagedResource; 
import org.springframework.stereotype.Component; 

@Component 
@ManagedResource(objectName="myapp:application=hello") 

public class HelloBean { 

    @ManagedOperation 
    public String sayHello(String name) { 
     return "Hello " + name; 
    } 
} 

가 나는 또한 스프링 컨텍스트 XML 파일에 다음을 추가 : 내가 jVisualVM에서 볼 때

<context:mbean-server /> 
<int-jmx:mbean-export id="integrationMBeanExporter" default-domain="spring.application" /> 

<bean id="helloBean" class="com.example.HelloBean" /> 

, 나는 콩이 표시되지 않는 다음은 내 코드입니다. spring.application 도메인에서는 MessageChannel을 볼 수 있지만 내 MBean은 볼 수 없습니다. image of MBeans in spring.integration

annotated MBeans을 visualVM에 표시하려면 다른 작업이 필요합니까?

감사합니다.

답변

2

<context:mbean-export/>입니다.

<int-jmx:mbean-export>은 스프링 통합 구성 요소에 대한 사용자 정의 MBeanExporter입니다. 다른 모든 것은 표준 Spring <context:mbean-export/>에 의해 관리되어야합니다.

+0

그게 전부입니다. 를 추가했는데 콩을 볼 수 있습니다. 고마워요. – kevin