spring-boot - Camel 上下文根本没有在 Hawtio JMX 中列出

标签 spring-boot apache-camel jmx hawtio

我已经在 tomcat 中部署了三个示例 apache camel 示例:

/camel-example-activemq-tomcat-3.5.0-SNAPSHOT   
/camel-example-cxf-tomcat-3.5.0-SNAPSHOT    
/camel-example-servlet-tomcat-3.5.0-SNAPSHOT
它们都已启动并运行正常。
其中之一使用 ActiveMQ,我可以从 Hawtio 看到队列。
Hawtio ActiveMQ tree
但是,在 JMX 下,未列出/发现 Camel 上下文。刷新页面没有任何改变。
Hawtio JMX tree
正在执行 mBeanServersInfo() (完整路径代码>http://localhost:8080/hawtio-default-2.10.0/jolokia/exec/jolokia:type=ServerHandler,qualifier=hawtio/mBeanServersInfo()),看起来是提供了原始数据来显示在 JMX 树中,生成以下内容:
Found 1 MBeanServers
    ++ com.sun.jmx.mbeanserver.JmxMBeanServer@56620197: default domain = DefaultDomain, 284 MBeans
        Domains:
         == java.util.logging
              type=Logging
         == jdk.management.jfr
              type=FlightRecorder
         == org.apache.activemq
              brokerName=myBroker,connectionName=vm_//myBroker#0,connectionViewType=remoteAddress,connector=clientConnectors,connectorName=vm,type=Broker
              brokerName=myBroker,connectionName=vm_//myBroker#2,connectionViewType=remoteAddress,connector=clientConnectors,connectorName=vm,type=Broker
              brokerName=myBroker,clientId=ID_WIN-10-DM-63203-1594039525518-3_1,endpoint=dynamicProducer,producerId=ID_WIN-10-DM-63203-1594039525518-4_1_2_1,type=Broker
              brokerName=myBroker,destinationName=ActiveMQ.Advisory.Connection,destinationType=Topic,type=Broker
              brokerName=myBroker,destinationName=ActiveMQ.Advisory.Queue,destinationType=Topic,type=Broker
              brokerName=myBroker,destinationName=inbox,destinationType=Queue,type=Broker
              brokerName=myBroker,connector=clientConnectors,connectorName=tcp,type=Broker
              brokerName=myBroker,instanceName=KahaDBPersistenceAdapter[C_\xampp\activemq-data\myBroker\KahaDB_Index_C_\xampp\activemq-data\myBroker\KahaDB],service=PersistenceAdapter,type=Broker
              brokerName=myBroker,connectionName=ID_WIN-10-DM-63203-1594039525518-3_1,connectionViewType=clientId,connector=clientConnectors,connectorName=vm,type=Broker
              brokerName=myBroker,type=Broker
              brokerName=myBroker,connector=clientConnectors,connectorName=vm,type=Broker
              brokerName=myBroker,clientId=ID_WIN-10-DM-63203-1594039525518-3_1,consumerId=ID_WIN-10-DM-63203-1594039525518-4_1_-1_1,destinationName=ActiveMQ.Advisory.TempQueue_ActiveMQ.Advisory.TempTopic,destinationType=Topic,endpoint=Consumer,type=Broker
              brokerName=myBroker,clientId=ID_WIN-10-DM-63203-1594039525518-5_1,endpoint=dynamicProducer,producerId=ID_WIN-10-DM-63203-1594039525518-6_1_1_1,type=Broker
              brokerName=myBroker,clientId=ID_WIN-10-DM-63203-1594039525518-5_1,consumerId=ID_WIN-10-DM-63203-1594039525518-6_1_-1_1,destinationName=ActiveMQ.Advisory.TempQueue_ActiveMQ.Advisory.TempTopic,destinationType=Topic,endpoint=Consumer,type=Broker
              brokerName=myBroker,destinationName=ActiveMQ.Advisory.Consumer.Queue.inbox,destinationType=Topic,type=Broker
              brokerName=myBroker,service=Health,type=Broker
              brokerName=myBroker,clientId=ID_WIN-10-DM-63203-1594039525518-3_1,consumerId=ID_WIN-10-DM-63203-1594039525518-4_1_1_1,destinationName=inbox,destinationType=Queue,endpoint=Consumer,type=Broker
              brokerName=myBroker,connectionName=ID_WIN-10-DM-63203-1594039525518-5_1,connectionViewType=clientId,connector=clientConnectors,connectorName=vm,type=Broker
              brokerName=myBroker,destinationName=outbox,destinationType=Queue,type=Broker
              brokerName=myBroker,destinationName=ActiveMQ.Advisory.MasterBroker,destinationType=Topic,type=Broker
         == java.nio
              name=direct,type=BufferPool
              name=mapped,type=BufferPool
         == Users
              database=UserDatabase,rolename="admin-script",type=Role
              database=UserDatabase,rolename="manager-gui",type=Role
              database=UserDatabase,rolename="admin-gui",type=Role
              database=UserDatabase,type=User,username="tomcat"
              database=UserDatabase,type=UserDatabase
              database=UserDatabase,rolename="manager-status",type=Role
              database=UserDatabase,rolename="manager-jmx",type=Role
              database=UserDatabase,rolename="manager-script",type=Role
         == JMImplementation
              type=MBeanServerDelegate
         == java.lang
              name=Metaspace Manager,type=MemoryManager
              name=Metaspace,type=MemoryPool
              name=CodeHeap 'profiled nmethods',type=MemoryPool
              type=ClassLoading
              type=Runtime
              name=CodeCacheManager,type=MemoryManager
              type=OperatingSystem
              name=Compressed Class Space,type=MemoryPool
              type=Threading
              name=CodeHeap 'non-nmethods',type=MemoryPool
              name=G1 Eden Space,type=MemoryPool
              name=G1 Old Gen,type=MemoryPool
              name=G1 Survivor Space,type=MemoryPool
              name=G1 Young Generation,type=GarbageCollector
              type=Memory
              type=Compilation
              name=G1 Old Generation,type=GarbageCollector
              name=CodeHeap 'non-profiled nmethods',type=MemoryPool
         == com.sun.management
              type=HotSpotDiagnostic
              type=DiagnosticCommand
         == jmx4perl
              qualifier=hawtio,type=Config
         == org.apache.logging.log4j2
              component=ContextSelector,type=20ca6c9a
              component=ContextSelector,type=6f5f79f0
              component=Loggers,name=,type=6f5f79f0
              component=Appenders,name=console,type=6f5f79f0
              component=Loggers,name=,type=2cfeff1b
              component=Appenders,name=console,type=20ca6c9a
              type=2cfeff1b
              component=ContextSelector,type=2cfeff1b
              type=6f5f79f0
              component=Appenders,name=console,type=2cfeff1b
              component=StatusLogger,type=2cfeff1b
              type=20ca6c9a
              component=StatusLogger,type=20ca6c9a
              component=StatusLogger,type=6f5f79f0
              component=Loggers,name=,type=20ca6c9a
         == hawtio
              type=Registry
              type=About
              type=IdeFacade
              type=ConfigFacade
              type=LogQuery
              type=TreeWatcher
              name=RBACRegistry,type=security
              area=jmx,name=HawtioDummyJMXSecurity,rank=0,type=security
         == Catalina
              context=/host-manager,host=localhost,type=Loader
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/host-manager,j2eeType=Servlet,name=HostManager
              context=/hawtio-default-2.10.0,host=localhost,name=hawtio/role,resourcetype=Context,type=Environment
              context=/manager,host=localhost,type=Cache
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=wsEchoMessage
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/camel-example-activemq-tomcat-3.5.0-SNAPSHOT,j2eeType=Servlet,name=default
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/camel-example-cxf-tomcat-3.5.0-SNAPSHOT,name=jsp,type=JspMonitor
              name="http-bio-8080",type=GlobalRequestProcessor
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/manager,j2eeType=Servlet,name=default
              context=/hawtio-default-2.10.0,host=localhost,name=hawtio/realm,resourcetype=Context,type=Environment
              name=HttpRequest4,type=RequestProcessor,worker="http-bio-8080"
              context=/hawtio-default-2.10.0,host=localhost,name=NonLoginAuthenticator,type=Valve
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/hawtio-default-2.10.0,j2eeType=Filter,name=XContentTypeOptionsFilter
              J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/hawtio-default-2.10.0
              context=/manager,host=localhost,type=Loader
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=SessionExample
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=RequestHeaderExample
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/hawtio-default-2.10.0,j2eeType=Filter,name=XXSSProtectionFilter
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/manager,j2eeType=Filter,name=Tomcat WebSocket (JSR356) Filter
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/camel-example-servlet-tomcat-3.5.0-SNAPSHOT,j2eeType=Filter,name=Tomcat WebSocket (JSR356) Filter
              context=/host-manager,host=localhost,name=StandardContextValve,type=Valve
              context=/camel-example-cxf-tomcat-3.5.0-SNAPSHOT,host=localhost,type=Manager
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=wsEchoStream
              type=Service
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=jsp
              context=/docs,host=localhost,name=NonLoginAuthenticator,type=Valve
              context=/hawtio-default-2.10.0,host=localhost,name=hawtio/rolePrincipalClasses,resourcetype=Context,type=Environment
              context=/hawtio-default-2.10.0,host=localhost,type=Cache
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/hawtio-default-2.10.0,j2eeType=Servlet,name=keycloak
              context=/camel-example-servlet-tomcat-3.5.0-SNAPSHOT,host=localhost,name=StandardContextValve,type=Valve
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/manager,name=jsp,type=JspMonitor
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/camel-example-servlet-tomcat-3.5.0-SNAPSHOT,name=jsp,type=JspMonitor
              name=HttpRequest2,type=RequestProcessor,worker="http-bio-8080"
              J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/docs
              context=/camel-example-activemq-tomcat-3.5.0-SNAPSHOT,host=localhost,type=Manager
              context=/examples,host=localhost,type=Manager
              context=/examples,host=localhost,name=minExemptions,resourcetype=Context,type=Environment
              context=/docs,host=localhost,type=Loader
              type=StringCache
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/camel-example-servlet-tomcat-3.5.0-SNAPSHOT,j2eeType=Servlet,name=jsp
              context=/camel-example-cxf-tomcat-3.5.0-SNAPSHOT,host=localhost,type=WebappClassLoader
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Filter,name=Tomcat WebSocket (JSR356) Filter
              context=/examples,host=localhost,type=WebappClassLoader
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/camel-example-cxf-tomcat-3.5.0-SNAPSHOT,j2eeType=Filter,name=Tomcat WebSocket (JSR356) Filter
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/hawtio-default-2.10.0,j2eeType=Servlet,name=plugin
              context=/host-manager,host=localhost,type=Manager
              J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/camel-example-activemq-tomcat-3.5.0-SNAPSHOT
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/hawtio-default-2.10.0,j2eeType=Filter,name=Tomcat WebSocket (JSR356) Filter
              context=/,host=localhost,type=NamingResources
              context=/camel-example-servlet-tomcat-3.5.0-SNAPSHOT,host=localhost,type=Manager
              context=/camel-example-servlet-tomcat-3.5.0-SNAPSHOT,host=localhost,type=NamingResources
              context=/camel-example-activemq-tomcat-3.5.0-SNAPSHOT,host=localhost,type=WebappClassLoader
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/manager,j2eeType=Filter,name=CSRF
              type=Engine
              context=/camel-example-servlet-tomcat-3.5.0-SNAPSHOT,host=localhost,type=Cache
              context=/camel-example-servlet-tomcat-3.5.0-SNAPSHOT,host=localhost,type=WebappClassLoader
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/docs,j2eeType=Servlet,name=jsp
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/host-manager,j2eeType=Servlet,name=jsp
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/hawtio-default-2.10.0,j2eeType=Servlet,name=login
              context=/camel-example-cxf-tomcat-3.5.0-SNAPSHOT,host=localhost,type=Cache
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/hawtio-default-2.10.0,name=jsp,type=JspMonitor
              context=/camel-example-activemq-tomcat-3.5.0-SNAPSHOT,host=localhost,type=Loader
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=ChatServlet
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Filter,name=Request Dumper Filter
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=RequestParamExample
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/hawtio-default-2.10.0,j2eeType=Servlet,name=default
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/hawtio-default-2.10.0,j2eeType=Filter,name=SessionExpiryFilter
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/hawtio-default-2.10.0,j2eeType=Filter,name=ContentSecurityPolicyFilter
              context=/camel-example-cxf-tomcat-3.5.0-SNAPSHOT,host=localhost,type=Loader
              realmPath=/realm0/realm0,type=Realm
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,name=jsp,type=JspMonitor
              context=/camel-example-activemq-tomcat-3.5.0-SNAPSHOT,host=localhost,type=NamingResources
              name=HttpRequest8,type=RequestProcessor,worker="http-bio-8080"
              type=MBeanFactory
              J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/
              port=8080,type=ProtocolHandler
              name=StandardEngineValve,type=Valve
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=CookieExample
              J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/examples
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=RequestInfoExample
              context=/manager,host=localhost,type=Manager
              name=HttpRequest7,type=RequestProcessor,worker="http-bio-8080"
              context=/camel-example-activemq-tomcat-3.5.0-SNAPSHOT,host=localhost,name=NonLoginAuthenticator,type=Valve
              context=/manager,host=localhost,name=StandardContextValve,type=Valve
              context=/examples,host=localhost,type=Loader
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/docs,j2eeType=Servlet,name=default
              context=/manager,host=localhost,type=WebappClassLoader
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Filter,name=Compression Filter
              context=/docs,host=localhost,type=NamingResources
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=wsChat
              name=HttpRequest6,type=RequestProcessor,worker="http-bio-8080"
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/manager,j2eeType=Filter,name=SetCharacterEncoding
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/manager,j2eeType=Servlet,name=Status
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/,j2eeType=Filter,name=Tomcat WebSocket (JSR356) Filter
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=wsSnake
              context=/hawtio-default-2.10.0,host=localhost,name=StandardContextValve,type=Valve
              J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/camel-example-cxf-tomcat-3.5.0-SNAPSHOT
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/manager,j2eeType=Servlet,name=JMXProxy
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/manager,j2eeType=Servlet,name=HTMLManager
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/camel-example-servlet-tomcat-3.5.0-SNAPSHOT,j2eeType=Servlet,name=default
              name=HttpRequest5,type=RequestProcessor,worker="http-bio-8080"
              context=/host-manager,host=localhost,type=NamingResources
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/host-manager,j2eeType=Filter,name=Tomcat WebSocket (JSR356) Filter
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/camel-example-cxf-tomcat-3.5.0-SNAPSHOT,j2eeType=Servlet,name=CXFServlet
              context=/,host=localhost,type=Loader
              context=/docs,host=localhost,type=WebappClassLoader
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/camel-example-activemq-tomcat-3.5.0-SNAPSHOT,name=jsp,type=JspMonitor
              context=/camel-example-activemq-tomcat-3.5.0-SNAPSHOT,host=localhost,type=Cache
              context=/camel-example-cxf-tomcat-3.5.0-SNAPSHOT,host=localhost,type=NamingResources
              context=/examples,host=localhost,name=name3,resourcetype=Context,type=Environment
              J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/camel-example-servlet-tomcat-3.5.0-SNAPSHOT
              context=/hawtio-default-2.10.0,host=localhost,type=Loader
              context=/examples,host=localhost,type=NamingResources
              context=/hawtio-default-2.10.0,host=localhost,type=NamingResources
              type=NamingResources
              context=/,host=localhost,type=WebappClassLoader
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/camel-example-cxf-tomcat-3.5.0-SNAPSHOT,j2eeType=Servlet,name=jsp
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=stock
              context=/hawtio-default-2.10.0,host=localhost,type=WebappClassLoader
              context=/examples,host=localhost,name=foo/name1,resourcetype=Context,type=Environment
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=ServletToJsp
              context=/camel-example-servlet-tomcat-3.5.0-SNAPSHOT,host=localhost,name=NonLoginAuthenticator,type=Valve
              context=/docs,host=localhost,name=StandardContextValve,type=Valve
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/hawtio-default-2.10.0,j2eeType=Filter,name=cache
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/host-manager,j2eeType=Servlet,name=HTMLHostManager
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/hawtio-default-2.10.0,j2eeType=Servlet,name=jsp
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/hawtio-default-2.10.0,j2eeType=Servlet,name=user
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=async1
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/host-manager,j2eeType=Servlet,name=default
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=async0
              realmPath=/realm0,type=Realm
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=async3
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=async2
              context=/manager,host=localhost,type=NamingResources
              host=localhost,type=Deployer
              class=org.apache.catalina.UserDatabase,name="UserDatabase",resourcetype=Global,type=Resource
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/manager,j2eeType=Servlet,name=Manager
              context=/host-manager,host=localhost,name=BasicAuthenticator,type=Valve
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/hawtio-default-2.10.0,j2eeType=Filter,name=AuthenticationFilter
              context=/examples,host=localhost,type=Cache
              context=/hawtio-default-2.10.0,host=localhost,name=hawtio/keycloakEnabled,resourcetype=Context,type=Environment
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Filter,name=Timing filter
              name=HttpRequest1,type=RequestProcessor,worker="http-bio-8080"
              name=HttpRequest9,type=RequestProcessor,worker="http-bio-8080"
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/,j2eeType=Servlet,name=default
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=CompressionFilterTestServlet
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/hawtio-default-2.10.0,j2eeType=Servlet,name=logout
              port=8080,type=Connector
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/hawtio-default-2.10.0,j2eeType=Servlet,name=jolokia-agent
              context=/,host=localhost,type=Cache
              name=HttpRequest3,type=RequestProcessor,worker="http-bio-8080"
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/hawtio-default-2.10.0,j2eeType=Filter,name=StrictTransportSecurityFilter
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/host-manager,j2eeType=Filter,name=CSRF
              J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/manager
              host=localhost,name=ErrorReportValve,type=Valve
              host=localhost,type=Host
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/host-manager,name=jsp,type=JspMonitor
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/hawtio-default-2.10.0,j2eeType=Servlet,name=jolokia-proxy
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/docs,name=jsp,type=JspMonitor
              port=8080,type=Mapper
              context=/examples,host=localhost,name=FormAuthenticator,type=Valve
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=default
              context=/,host=localhost,type=Manager
              context=/manager,host=localhost,name=BasicAuthenticator,type=Valve
              context=/examples,host=localhost,name=StandardContextValve,type=Valve
              context=/host-manager,host=localhost,type=WebappClassLoader
              host=localhost,name=AccessLogValve,type=Valve
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/,j2eeType=Servlet,name=jsp
              context=/hawtio-default-2.10.0,host=localhost,name=hawtio/authenticationEnabled,resourcetype=Context,type=Environment
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/docs,j2eeType=Filter,name=Tomcat WebSocket (JSR356) Filter
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/,name=jsp,type=JspMonitor
              context=/camel-example-servlet-tomcat-3.5.0-SNAPSHOT,host=localhost,type=Loader
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/hawtio-default-2.10.0,j2eeType=Filter,name=XFrameOptionsFilter
              context=/hawtio-default-2.10.0,host=localhost,name=hawtio/keycloakClientConfig,resourcetype=Context,type=Environment
              context=/docs,host=localhost,type=Cache
              host=localhost,name=StandardHostValve,type=Valve
              context=/docs,host=localhost,type=Manager
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/host-manager,j2eeType=Filter,name=SetCharacterEncoding
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/hawtio-default-2.10.0,j2eeType=Filter,name=PublicKeyPinningFilter
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/hawtio-default-2.10.0,j2eeType=Filter,name=BaseTagHrefFilter
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/hawtio-default-2.10.0,j2eeType=Filter,name=LoginRedirectFilter
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/camel-example-activemq-tomcat-3.5.0-SNAPSHOT,j2eeType=Servlet,name=jsp
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/hawtio-default-2.10.0,j2eeType=Filter,name=CORSFilter
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/camel-example-cxf-tomcat-3.5.0-SNAPSHOT,j2eeType=Servlet,name=default
              name="http-bio-8080",type=ThreadPool
              context=/hawtio-default-2.10.0,host=localhost,name=hawtio/sessionTimeout,resourcetype=Context,type=Environment
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=HelloWorldExample
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/camel-example-activemq-tomcat-3.5.0-SNAPSHOT,j2eeType=Filter,name=Tomcat WebSocket (JSR356) Filter
              context=/hawtio-default-2.10.0,host=localhost,type=Manager
              J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/host-manager
              type=Server
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/manager,j2eeType=Servlet,name=jsp
              context=/camel-example-cxf-tomcat-3.5.0-SNAPSHOT,host=localhost,name=NonLoginAuthenticator,type=Valve
              context=/,host=localhost,name=StandardContextValve,type=Valve
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/camel-example-servlet-tomcat-3.5.0-SNAPSHOT,j2eeType=Servlet,name=CamelServlet
              name=HttpRequest10,type=RequestProcessor,worker="http-bio-8080"
              context=/hawtio-default-2.10.0,host=localhost,name=hawtio/authenticationContainerDiscoveryClasses,resourcetype=Context,type=Environment
              context=/,host=localhost,name=NonLoginAuthenticator,type=Valve
              context=/examples,host=localhost,name=foo/name4,resourcetype=Context,type=Environment
              context=/camel-example-activemq-tomcat-3.5.0-SNAPSHOT,host=localhost,name=StandardContextValve,type=Valve
              context=/camel-example-cxf-tomcat-3.5.0-SNAPSHOT,host=localhost,name=StandardContextValve,type=Valve
              context=/examples,host=localhost,name=foo/bar/name2,resourcetype=Context,type=Environment
              J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Filter,name=Set Character Encoding
              context=/host-manager,host=localhost,type=Cache
         == jolokia
              type=Discovery
              qualifier=hawtio,type=Config
              qualifier=hawtio,type=ServerHandler

Platform MBeanServer: com.sun.jmx.mbeanserver.JmxMBeanServer@56620197
如您所见,没有 == org.apache.camel列出。
Hawtio 管理控制台列出了以下版本:
Hawtio    2.10.0
Hawtio Core    4.13.0
Hawtio Integration    4.13.5
Hawtio OAuth    4.12.1
整个设置在 XAMPP 服务器中运行:
XAMPP console
Apache Tomcat 是 v7.0.104,整个过程在 Java SE v11.07 上运行。
预先感谢您提供的任何帮助。

最佳答案

从 Camel 3.0 开始,JMX 默认被禁用。要启用 JMX,您需要添加 camel-management 依赖性。
如果您使用的是 maven,请添加 camel-managementpom.xml :

<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-management</artifactId>
  <version>${camel.version}</version>
</dependency>

关于spring-boot - Camel 上下文根本没有在 Hawtio JMX 中列出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62757389/

相关文章:

java - Camel 是否可以捕获 netty 异常?

java - 无法注册 MBean

java - JMX 字段和方法的描述 JBoss

java - 启动 Eclipse Spring Boot 时出错。 - Java 已启动但返回退出代码=13

java - 无法通过 Spring Security 的 LDAP 身份验证登录

spring - 使用哪个 spring 事务隔离级别来维护已售产品的计数器?

java - apache Camel 和 optaplanner 之间的连接

java - Camel useOriginalMessage 不工作

ruby - 如何在RHEL中安装logstash-input-jmx?

java - Multipart transferTo 在使用 createTempFile 时查找错误的文件地址