当前位置:网站首页>Arthas' dynamic load class (retransform)
Arthas' dynamic load class (retransform)
2022-07-26 02:45:00 【Curious rookie】
One 、 demand
There is an interface on the line as follows . Because of business needs , Can't shut down , Modify the interface to return to all uppercase + Time stamp ;
http://192.168.1.4:5656/hi@RestController
public class HelloController {
@GetMapping("/hi")
public String getMessage(String msg) {
return msg.toLowerCase()+System.currentTimeMillis();
}
}
Two 、 Dynamic replacement jvm Load class
1、 Modify the code
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HelloController {
public HelloController() {
}
@GetMapping({"/hi"})
public String getMessage(String msg) {
return msg.toUpperCase() + System.currentTimeMillis();
}
}2、 Compiled into class file

3、 Upload to the specified directory of the service

4、 Use Arthas Replace
start-up arthas, Select replacement items , perform
retransform /usr/local/jar/HelloController.class


5、 test
边栏推荐
- [steering wheel] how to transfer the start command and idea: VM parameters, command line parameters, system parameters, environment variable parameters, main method parameters
- JS get the time composition array of two time periods
- 简单使用 MySQL 索引
- How to design test cases according to the requirements of login testing?
- Manifold learning
- From the annual reports of major apps, we can see that user portraits - labels know you better than you do
- LeetCode_ Dynamic programming_ Medium_ 264. Ugly number II
- Recorded target detection NMS (non maximum suppression)
- Annotation development
- IDEA运行web项目出现乱码问题有效解决(附详细步骤)
猜你喜欢

Information System Project Manager - Chapter 10 communication management and stakeholder management examination questions over the years

TCP three handshakes and four waves

信息系统项目管理师必背核心考点(五十)合同内容约定不明确规定

Personally test five efficient and practical ways to get rid of orders, and quickly collect them to help you quickly find high-quality objects!

对于稳定性测试必需关注的26点

【方向盘】使用IDEA的60+个快捷键分享给你,权为了提效(Live Template&Postfix Completion篇)

Self-supervised learning method to solve the inverse problem of Fokker-Planck Equation

GAMES101复习:着色(Shading)、渲染管线

从各大APP年度报告看用户画像——标签,比你更懂你自己

Games101 review: shading, rendering pipelines
随机推荐
关于mysql的问题,希望个位能帮一下忙
U++ common type conversion and common forms and proxies of lambda
How to design automated test cases?
如何根据登录测试的需求设计测试用例?
MySQL(4)
Vofa+ serial port debugging assistant
Neo4j 导入csv数据报错:Neo4j load csv error : Couldn‘t load the external resource
[steering wheel] use the 60 + shortcut keys of idea to share with you, in order to improve efficiency (reconstruction)
Primary key b+ tree, secondary index b+ tree and corresponding query process analysis
[C]详解语言文件操作
ES6高级-利用构造函数继承父类属性
uni-app跨域配置
Annotation development management third-party beans
图像识别(七)| 池化层是什么?有什么作用?
Digital warehouse: on the construction practice of digital warehouse in banking industry
Turn on the LED
从各大APP年度报告看用户画像——标签,比你更懂你自己
The El table header merges the first four columns into one cell
Is it safe to open galaxy securities account by mobile phone?
Keil's operation before programming with C language