Are CXF client proxies thread safe?

前端 未结 2 1868
隐瞒了意图╮
隐瞒了意图╮ 2021-01-12 10:03

I\'m using CXF to generate SOAP client classes. In the CXF documentation, they write

Are JAX-WS client proxies thread safe?

Official JAX-WS answer

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-12 10:30

    You're probably referring to runtime, but I don't think configuration time is meant to be threadsafe. I believe I've seen a race condition in JettyHTTPServerEngineFactory.

    In a test harness we bring up multiple unrelated SOAP servers and when they share a Bus there's a potential for a race condition if multiple threads attempt to add JettyHTTPServerEngine instances at the same time. The specific race condition is in setTLSServerParametersForPort(), which you call when you want to use HTTPS for a port. That method adds elements to a HashMap with no locking.

    I guess the reason others don't encounter this is that most people configure CXF via configuration files, and it's rare to have multiple ports/Jetty servers in one process.

提交回复
热议问题