在演示控制器中使用@EnableBinding.class会导致春季AOP失败



在我的应用程序中,在 DemoController 上使用@EnableBinding.class导致我的日志方面失败,不再有日志记录.
而且,如果删除@EnableBinding,日志方面工作。

UspeController.class像这样:

@RestController
@RequestMapping("/yeah/user")
@EnableBinding({OpenFileSystemOutput.class})
public class UspeController {
@Autowired
OpenFileSystemOutput openFileSystemOutput; 
@PutMapping(value = "/applyAccount")
public Result<?> applyAccount() throws Exception {
UserMessage userMessage = new UserMessage(UserInfoContext.getUserId());
openFileSystemOutput.output().send(MessageBuilder.withPayload(userMessage).build());
return ResultUtils.success("");
}
}

日志方面是这样的:

@Aspect
public class LogAspect {
@Pointcut("within(com.yeah..*) && @target(org.springframework.web.bind.annotation.RestController) ")
public void executionService() {
}
@Before(value = "executionService()")
public void doBefore(JoinPoint joinPoint) {
log.info("Api Interface: [{}], parameters: {}", request.getRequestURI(), JSON.toJSONString(getSerializableObject(joinPoint)));
}
}

从Spring Cloud Stream的3.1.x版本开始,不推荐使用EnableBinding。如果可以,请升级代码以使用最新的功能模型。有关更多详细信息,请参阅文档中的编程模型部分。

最新更新