当前位置: 首页 > news >正文

Spring-boot读书笔记一@JMXEndpoint

@JmxEndpoint Details:
@JmxEndpoint is a Spring Boot Actuator annotation that creates custom endpoints accessible only through JMX (Java Management Extensions), not via HTTP/web.

Key Differences:
Feature @Endpoint @JmxEndpoint
Access HTTP + JMX JMX only
URL /actuator/course N/A
JMX org.springframework.boot:type=Endpoint,name=Course org.springframework.boot:type=Endpoint,name=Course
Web exposure Yes No
Usage Example:

@Component
@JmxEndpoint(id = "course")
public class CourseJmxEndpoint {@Autowiredprivate CourseRepository courseRepository;@ReadOperationpublic List<String> getCourseNames() {// Only accessible via JMX, not HTTPreturn courseRepository.findAll().stream().map(Course::getName).collect(Collectors.toList());}@WriteOperationpublic void updateCourse(@Selector String courseName, String newDescription) {// JMX-only write operation}
}

Accessing JMX Endpoints:
1. JConsole (Built into JDK):

  • Run jconsole
  • Connect to your Spring Boot application
  • Navigate to MBeans → org.springframework.boot → Endpoint → Course

2. JMX Client Code:

MBeanServer server = ManagementFactory.getPlatformMBeanServer();
ObjectName objectName = new ObjectName("org.springframework.boot:type=Endpoint,name=Course");

3. Application Properties:


# Enable JMX (enabled by default)
spring.jmx.enabled=true
# Expose JMX endpoints
management.endpoints.jmx.exposure.include=*

When to Use @JmxEndpoint:

  • System administration operations
  • Internal monitoring tools
  • Operations not suitable for HTTP exposure
  • Legacy JMX-based monitoring systems
  • Sensitive operations that shouldn't be web-accessible

Security Benefits:

  • No HTTP exposure - Can't be accessed via web browsers
  • JMX authentication can be configured
  • Network isolation - JMX can be restricted to localhost

@JmxEndpoint is ideal for administrative operations that should only be accessible through JMX management tools, not web interfa

http://www.jsqmd.com/news/205619/

相关文章:

  • 2026医师资格证考试高效备考攻略:精选优质培训机构,助你一次通关 - 品牌测评鉴赏家
  • 终极蓝屏模拟器:让你的电脑安全“崩溃“的魔法工具
  • 2025图文矩阵公司用户推荐指数,收藏备用,ai数字人/视频矩阵/ai和数字人/ai搜索排名/ai数字人排行榜图文矩阵厂商推荐榜单 - 品牌推荐师
  • 2026年靠谱GRC高架地板服务排行榜,新测评精选GRC高架地板生产厂推荐 - 工业品网
  • Z-Image模型输入格式要求:提示词书写规范与建议
  • Zotero翻译插件实战指南:让学术研究跨越语言障碍
  • 告别千篇一律!2026最有创意的年会策划公司,方案看完就心动 - 速递信息
  • 海外雇佣公司推荐:Safeguard Global助力企业合规拓展全球市场__ - 品牌2025
  • OBS Composite Blur插件:解决视频模糊难题的终极方案
  • 2026中医执业考试刷题必看!3类王牌题库+避坑指南,少走90%的弯路 - 品牌测评鉴赏家
  • 活动策划公司哪家价格比较实在?“价格实在 + 效果在线” 公司清单推荐! - 速递信息
  • 2026年名义雇主EOR服务商综合测评:哪家服务商更适合企业出海业务? - 品牌2025
  • 2026年精密金相切割机质量大比拼:哪些品牌更值得信赖? - 品牌推荐大师
  • 扫码抽奖活动怎么做?再互动高性价比平台推荐企业直接套用 - 品牌智鉴榜
  • 2026年口碑好的AI搜索优化机构推荐,资质齐全的专业公司全解析 - 工业品牌热点
  • 2026中医执助考试题库怎么选?3类优质题库+避坑指南,帮你高效上岸 - 品牌测评鉴赏家
  • 2026保冷工程优选:保冷管托厂家推荐 - 栗子测评
  • PlayCover性能监控实战宝典:从卡顿到流畅的游戏体验蜕变
  • 3天搞定VSCode智能体重组:高效插件架构搭建全指南
  • 2026年口碑不错的AI搜索优化公司推荐:AI搜索优化公司哪家合适? - 工业品牌热点
  • Canonical Message Service vs UNS:智能制造系统中的两种语义集成路径 - 实践
  • VSCode智能体工具升级之路(99%的人都忽略的关键细节)
  • 2026矿用耐磨钢管厂家:矿用双抗涂塑钢管厂家,矿用涂塑管厂 - 栗子测评
  • vue 树组件 vxe-tree 如何异步判断右键菜单的权限控制,异步显示隐藏菜单选项
  • 2026年口碑不错的亲子传统文化公益研学推荐,靠谱亲子传统文化研学公益项目全解析 - 工业设备
  • 3个简单步骤轻松搞定Beyond Compare专业版授权
  • SO-VITS-SVC 5.0歌声转换技术完整实战手册:从原理到应用
  • OBS Composite Blur:5分钟掌握终极视频模糊神器
  • 2026中医执业考试资料怎么选?这份超全攻略帮你高效备考 - 品牌测评鉴赏家
  • 2026年离婚纠纷律师机构排行:离婚纠纷法律事务所哪家好? - 工业推荐榜