Axis2 generated Stubs are thread-safe?

瘦欲@ 提交于 2019-12-01 08:17:31

When I looked into Axis2 some time ago, I also had thread-safe related questions about it.

Finding information about Axis2's thread safety was difficult, but I finally ended up with the following Jira issue: https://issues.apache.org/jira/browse/AXIS2-4357

It is mentioned that:

Axis2 client side is not thread safe, and which was the case from the beginning of the project [...] use different stubs for different threads [...]

The issue itself is closed with a Won't Fix status and with the following note:

Axis2 stubs are not thread safe. As Deepal pointed out this is by design.

That about did it for me at that time.

Basically you need to use one stub per thread or you can use a stub pool as (if I remember correctly) the stubs can be reused (but still need to use one stub per thread to avoid any issues). Other seem to have used stub pools with success (see related SO question here).

One advice I usually follow regarding thread safety is: If it is not explicitly stated that something is thread safe, then assume it is not.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!