【问题标题】:Can Spring actuator be used with non-web Spring Boot application?Spring 执行器可以与非 Web Spring Boot 应用程序一起使用吗?
【发布时间】:2017-08-31 23:37:29
【问题描述】:

我有一个 Spring Boot 应用程序,它侦听来自 IBM MQ 输入队列的消息,对消息进行一些处理,然后将消息放入输出队列。

这样的应用程序可以使用 Spring 执行器来监视应用程序(例如心跳检查)吗?通过阅读 actuator 文档,它似乎只能与 Spring Web 应用程序一起使用?我的理解不正确吗?如果是这样,您能否提供有关如何在非 Web 应用程序中使用执行器的信息?

【问题讨论】:

    标签: java spring-boot spring-jms spring-boot-actuator application-monitoring


    【解决方案1】:

    除了在 Web 应用程序中运行时可以通过 HTTP 使用之外,Actuator 的端点还可以通过 JMX 在 Web 和非 Web 应用程序中使用。 Acuator 端点的 MBean 发布在 org.springframework.boot 域中。详情请查看relevant section of the documentation

    【讨论】:

    • 关于如何以编程方式访问 MBean 的任何示例?我发现的大多数示例都建议使用 JConsole。
    猜你喜欢
    • 2021-09-03
    • 1970-01-01
    • 2015-09-03
    • 2012-10-14
    • 1970-01-01
    • 2016-10-31
    • 1970-01-01
    • 2015-01-28
    • 1970-01-01
    相关资源
    最近更新 更多