I was not aware of the latest features in Stomp protocol but in general in ActiveMQ we define the openwire protocol with prefix tcp://
(or ssl://
for SSL secured transports). For Stomp they use stomp://
prefix and here is a sample of what can be configured on the ActiveMQ server side:
<transportConnectors>
<!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&wireformat.maxFrameSize=104857600"/>
<transportConnector name="stomp" uri="stomp://localhost:61613"/>
<transportConnector name="websocket" uri="ws://0.0.0.0:61614"/>
</transportConnectors>
Then assuming the configuration is similar to both ActiveMQ nodes and if you need to refer using failover protocol through openwire
you will use in you spring-boot config (yml format):
spring:
activemq:
broker-url=failover:(tcp://amq1:61616,tcp://amq2:61616)
but for using with stomp it will be:
spring:
activemq:
broker-url=failover:(stomp://amq1:61613,stomp://amq2:61613)
and for websocket stomp:
spring:
activemq:
broker-url=failover:(ws://amq1:61614,ws://amq2:61614)
Notes:
- the port changes to match with what is configured on ActiveMQ.
- it seems you don't really need a
@Configuation
bean: using the properties above would be enough to configure an ActiveMQ with failover.
- As there is a mention of websocket in your code, I also mention the three possibilities your AMQ potentially uses.
But for a better answer it would be better if you post your ActiveMQ transports section. If you do not have access to it, I would suggest you contact your ActiveMQ administrator to ask the proper url's and what are the way to access the ActiveMQ (there are also other protocols that can be enabled like MQTT and AMPQ to mention the most used).
@Configuration
Bean. – Chambertinfailover:(stomp://amq1:61613,stomp://amq2:61613)
. After perhaps it depends how it is configured on the AMQ side but in our case as we enabled both protocols, we usetcp:
for openwire andstomp:
for stomp. – Chambertin