[英]SOAP over WebSockets in Apache CXF?
CXF是否支持WebSockets作為傳輸協議?
我需要支持多路復用SOAP和WebSocket協議看起來很完美作為起點。 它是雙向和全雙工協議。 通過多路復用我的意思是客戶端可以在不等待響應的情況下發送消息,並且響應可以按照它們被發送的不同順序發回(我將使用消息/對話ID來識別請求和響應)
它應該非常類似於JMS,其中CXF可以接收請求並以任何順序異步發送響應,例如:
我查找了郵件列表歷史記錄中的信息,但是如果CXF支持開箱即用的WebSocket或者我需要實現自己的傳輸 ,我仍然不清楚這一點?
我問的問題仍然有效,但有一個答案讓我滿意:)
我可以簡單地使用JMS代替java.util.concurrent
隊列。 然后,根據上下文和可伸縮性要求,我可以使用in-jvm隊列或分布式隊列。 在這種情況下,CXF已經支持SOAP over JMS 。
需要確保的是每個WebSocket連接有一個隊列(或者可以使用JMS消息選擇器 )。 這是因為WebSocket A收到的對請求的響應必須使用相同的連接發回。
嗨,有點遲到的答案我猜,但似乎在CXF支持Soap over Websocket。 配置它的主要問題是獲得正確的網絡依賴關系,這在CXF網站上沒有正確描述。 以下文章描述了對我有用的依賴項列表:
使用Appache CXF和Embedded Jetty的SOAP over Websocket
該帖子包含使用websocket傳輸的CXF soap端點的工作示例。
我將總結將使其工作的必要依賴項:
<dependency>
<groupId>org.asynchttpclient</groupId>
<artifactId>async-http-client</artifactId>
<version>2.0.39</version>
<exclusions>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-codec-http</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-transport</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-common</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-codec</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.0.56.Final</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-websocket</artifactId>
<version>3.3.2</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>3.3.2</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>3.3.2</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>3.3.2</version>
</dependency>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.