SOAP via WebSockets in Apache CXF?

Does CXF support WebSockets as a transport protocol?

I need to support the multiplexed SOAP and WebSocket protocol, which looks like a starting point. This is a bidirectional and full duplex protocol. When multiplexing, I mean that the client can send messages without waiting for a response, and the responses can be sent back in the different order in which they were sent (I will use the message / conversation identifier to identify the request and response)

It should be very similar to JMS, where CXF can receive requests and send responses asynchronously and in any order, for example:

I searched for information in the history of the mailing list, but it’s still not clear to me whether CXF supports WebSocket out of the box or do I need to implement my own transport ?

+5
source share
2 answers

The question I asked is still valid, but there is one answer that satisfies me :)

Instead of queues, java.util.concurrentI can just use JMS. Then, depending on context requirements and scalability, I can use a queue in jvm or distributed queues. In this case, CXF already supports SOAP over JMS .

, WebSocket ( JMS Message Selector). , , WebSocket A, .

0

, , , , Soap over Websocket CXF. - netty, - CXF. , , :

SOAP Websocket Appache CXF Jetty

:

<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>
0

Source: https://habr.com/ru/post/1535687/


All Articles