如何拦截Spring Cloud Function消息

问题描述 投票:0回答:0

我正在从 Spring Cloud Streams 和已弃用的 StreamListeners 迁移到 Spring Cloud Function 及其消费者。我在我的应用程序中有一个拦截器来为我的输入消息配置一些日志元数据和用户上下文(线程本地信息)。这是用这种拦截器完成的:https://stackoverflow.com/a/37466442/5230740.

现在,在 Spring Cloud Function 中,拦截器不再起作用了。我在 Internet 上找到了名为

org.springframework.cloud.function.context.catalog.FunctionAroundWrapper
的功能并且它有效,但我没有在 Spring 页面中找到关于它的好文档。所以,我不知道我是否可以依赖这个功能或者我应该使用其他方法?

java spring spring-cloud-stream
© www.soinside.com 2019 - 2024. All rights reserved.