当前位置:网站首页>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
边栏推荐
- 1.软件测试-----软件测试的基本概念
- pbootcms上传缩略图尺寸自动缩小变模糊
- ERROR: could not extract tar starting at offset 000000000000020980+9231072+2
- 18. Delete the penultimate node of the linked list
- 流形学习、、
- Yum install MySQL FAQ
- massCode 一款优秀的开源代码片段管理器
- 【方向盘】使用IDEA的60+个快捷键分享给你,权为了提效(重构篇)
- (pc+wap) dream weaving template vegetable and fruit websites
- From the annual reports of major apps, we can see that user portraits - labels know you better than you do
猜你喜欢

AMD64 (x86_64) architecture ABI document: medium

ES6高级-利用构造函数继承父类属性

Exclusive interview with ringcentral he Bicang: empowering future mixed office with innovative MVP

Exclusive interview with ringcentral he Bicang: empowering future mixed office with innovative MVP

ES6高级-利用原型对象继承方法
![[early knowledge of activities] list of recent activities of livevideostack](/img/14/d2cdae45a18a5bba7ee1ffab903af2.jpg)
[early knowledge of activities] list of recent activities of livevideostack

Annotation development management third-party beans

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

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

Games101 review: shading, rendering pipelines
随机推荐
Binary search 33. search rotation sort array
Brief introduction and use of NPM link
Wechat applet - get user location (longitude and latitude + city)
18. Delete the penultimate node of the linked list
U++ print information to screen and log
Handling process of the problem that the virtual machine's intranet communication Ping fails
uni-app跨域配置
The El table header merges the first four columns into one cell
Eslint common error reporting set
pbootcms上传缩略图尺寸自动缩小变模糊
Turn on the LED
JS get the time composition array of two time periods
How can users create data tables on Web pages and store them in the database
Yum install MySQL FAQ
Difference between soft link and hard link
【方向盘】工具提效:Sublime Text 4的常用快捷键合集
eslint常见报错集合
Wechat official account mutual aid, open white groups, and small white newspaper groups to keep warm
软件测试岗:阿里三面,幸好做足了准备,已拿offer
Exclusive interview with ringcentral he Bicang: empowering future mixed office with innovative MVP