如何在 @RabbitListener 方法中创建 Authentication 对象?
温馨提示:
本文最后更新于 2024年04月12日,已超过 48 天没有更新。若文章内的图片失效(无法正常加载),请留言反馈或直接联系我。
在我的应用程序中,有一个监听器,它使用需要Spring Security身份验证和请求信息的方法进行操作。不幸的是,这些方法在运行时没有身份验证令牌,并且请求未绑定到任何线程,因此当 RabbitMQ 尝试发送这些请求时,会引发异常:
No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.
正文到此结束
- 本文标签: 家庭宠物
- 本文链接: https://www.coder6.net/article/2289
- 版权声明: 本文由蚂蚁原创发布,转载请遵循《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》许可协议授权
热门推荐
-
浏览(193) 评论(0)