SpringCloud 手动命令设置
2023-12-02 11:07 更新
假定您具有以下HystrixCommand
:
HystrixCommand<String> hystrixCommand = new HystrixCommand<String>(setter) { @Override protected String run() throws Exception { return someLogic(); } };
要传递跟踪信息,必须在HystrixCommand
的Sleuth版本中包装相同的逻辑,称为TraceCommand
,如以下示例所示:
TraceCommand<String> traceCommand = new TraceCommand<String>(tracer, setter) { @Override public String doRun() throws Exception { return someLogic(); } };
以上内容是否对您有帮助:
更多建议: