|
|
|
@ -23,7 +23,6 @@ import org.springframework.messaging.simp.config.MessageBrokerRegistry; |
|
|
|
import org.springframework.messaging.simp.stomp.StompReactorNettyCodec; |
|
|
|
import org.springframework.messaging.simp.stomp.StompReactorNettyCodec; |
|
|
|
import org.springframework.messaging.tcp.reactor.ReactorNettyTcpClient; |
|
|
|
import org.springframework.messaging.tcp.reactor.ReactorNettyTcpClient; |
|
|
|
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker; |
|
|
|
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker; |
|
|
|
import org.springframework.web.socket.config.annotation.StompEndpointRegistry; |
|
|
|
|
|
|
|
import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer; |
|
|
|
import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer; |
|
|
|
|
|
|
|
|
|
|
|
// tag::snippet[]
|
|
|
|
// tag::snippet[]
|
|
|
|
@ -41,7 +40,7 @@ public class WebSocketConfiguration implements WebSocketMessageBrokerConfigurer |
|
|
|
|
|
|
|
|
|
|
|
private ReactorNettyTcpClient<byte[]> createTcpClient() { |
|
|
|
private ReactorNettyTcpClient<byte[]> createTcpClient() { |
|
|
|
return new ReactorNettyTcpClient<>( |
|
|
|
return new ReactorNettyTcpClient<>( |
|
|
|
client -> client.addressSupplier(() -> new InetSocketAddress(0)), |
|
|
|
client -> client.remoteAddress(() -> new InetSocketAddress(0)), |
|
|
|
new StompReactorNettyCodec()); |
|
|
|
new StompReactorNettyCodec()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|