HystrixCommand注解导致Session关闭错误

HystrixCommand annotation causes Session closed errors

我有一个 spring 应用程序,我正尝试通过 Hystrix 在其上使用断路器模式。我用 @HystrixCommand 注释在我的服务中标记了一个方法。此方法调用了一个存储库,该存储库在没有 @HystrixCommand 注释的情况下也能正常工作。

但是,简单地添加注释会给我带来一堆运行时异常 - org.hibernate.SessionException:会话已关闭!和 java.net.ConnectException。我对 @HystrixCommand 或 spring 的了解还不够,无法真正理解这里发生了什么。在使用 Hystrix 之前,我需要了解我的存储库连接吗?我基本上只是按照这里的指南操作:https://spring.io/guides/gs/circuit-breaker/

感谢任何反馈或线索。

只需将以下配置添加到您的 properties/yml 文件

hystrix.command.default.execution.isolation.strategy: SEMAPHORE

Here is some documentation for further reading