我想在 websocket 上使用 stomp 并打算与 Amazon MQ 集成,但 Amazon MQ 默认使用 stomp+ssl,然后我遇到了我的问题。
@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
@Autowired
private ActiveMQProperties activeMQProperties;
/**
* Register STOMP endpoints mapping each to a specific URL and (optionally)
* enabling and configuring SockJS fallback options.
*
* @param registry
*/
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/endpoint").setAllowedOrigins("*");
}
/**
* Configure message broker options.
*
* @param registry
*/
@Override
public void configureMessageBroker(MessageBrokerRegistry registry) {
registry.setApplicationDestinationPrefixes("/app");
registry.enableStompBrokerRelay("/queue", "/topic")
.setAutoStartup(true)
.setVirtualHost(activeMQProperties.getHost())
.setRelayHost(activeMQProperties.getHost())
.setRelayPort(activeMQProperties.getPort())
.setSystemLogin(activeMQProperties.getUser())
.setSystemPasscode(activeMQProperties.getPassword())
.setClientLogin(activeMQProperties.getUser())
.setClientPasscode(activeMQProperties.getPassword());
}}
ReactorNettyTcpClient是spring-messaging-5.1.*中TcpOperations的实现,怎么支持SSL呢?