我正在创建一个 Spring 后端应用程序,它主要公开其余入口点。
此应用程序连接到各种远程服务,包括多个 SOAP Web 服务。
为了以良好的性能响应请求,为 SOAP 客户端服务创建一个池是一个好主意吗?使用 CommonsPoolTargetSource ?
是否有一些资源可以在 Spring 启动环境中使用基于 Java 的配置来完成这种假脱机?
我还在考虑使用 Spring Integration 实现 EIP 总线; “池部分”可以在其中完成吗?
最佳答案
看来您误解了 AbstractPoolingTargetSource
的目的:
* Abstract base class for pooling {@link org.springframework.aop.TargetSource}
* implementations which maintain a pool of target instances, acquiring and
* releasing a target object from the pool for each method invocation.
* This abstract base class is independent of concrete pooling technology;
* see the subclass {@link CommonsPool2TargetSource} for a concrete example.
使用 Spring WS(和 Spring Integration WS 适配器),您不需要任何池
。客户端基础设施的这些组件是单例的,因此它们是可重用且线程安全的。
我完全不明白你要在那里汇集什么......
以及不确定是否可以汇集在EIP总线中。我还没有说,有了 Spring Integration,它就不再是一种模式了。
关于java - Spring和Soap客户端,使用池化吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37099053/