179.6. 자체 Camel 코드에 JMX 사용


179.6.1. 관리형 엔드 포인트 등록

Camel 2.0으로 사용가능한
Spring 관리 주석 @ManagedResource 로 끝점을 장식하여 Camel MBeanServer 에 등록할 수 있으므로 JMX를 사용하여 사용자 정의 MBean에 액세스할 수 있습니다.

참고

Camel 2.1 에서는 엔드포인트 이외의 엔드포인트를 적용하도록 변경했지만, 인터페이스 org.apache.camel.spi.ManagementAware 도 구현해야 합니다. 나중에 이에 대해 더 알아보기

예를 들어 관리할 몇 가지 옵션을 정의하는 다음과 같은 사용자 지정 엔드포인트가 있습니다.

@ManagedResource(description = "Our custom managed endpoint")
public class CustomEndpoint extends MockEndpoint implements ManagementAware<CustomEndpoint> {

    public CustomEndpoint(final String endpointUri, final Component component) {
        super(endpointUri, component);
    }

    public Object getManagedObject(CustomEndpoint object) {
        return this;
    }

    public boolean isSingleton() {
        return true;
    }

    protected String createEndpointUri() {
        return "custom";
    }

    @ManagedAttribute
    public String getFoo() {
        return "bar";
    }

    @ManagedAttribute
    public String getEndpointUri() {
        return super.getEndpointUri();
    }
}
Copy to Clipboard Toggle word wrap

Camel 2.9 부터 org.apache.camel.api.management 패키지에서 @ManagedResource,@ManagedAttribute@ManagedOperation 을 사용하는 것이 좋습니다. 이를 통해 사용자 정의 코드는 Spring JAR에 의존하지 않습니다.

Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2026 Red Hat
맨 위로 이동