Search code examples
springrabbitmqspring-websocket

Spring Websocket mutiple broker relay addresses?


I have a cluster of RabbitMQ servers. I want to load balance my StompBrokerRelay requests from my spring boot application (with websockets) to the nodes across the cluster, BUT i don't see where I can set a list of addresses with the MessageBrokerRegistry. Right now the configuration looks like this:

  @Override
  public void configureMessageBroker(MessageBrokerRegistry config) {
    config
        .enableStompBrokerRelay("/exchange")
        .setAutoStartup(true)
        .setVirtualHost(BROKER_VHOST)
        .setRelayHost(BROKER_HOST)
        .setRelayPort(BROKER_PORT)
        .setClientLogin(BROKER_CLIENT_LOGIN)
        .setClientPasscode(BROKER_CLIENT_PASSWORD)
        .setSystemLogin(BROKER_SYSTEM_LOGIN)
        .setSystemPasscode(BROKER_SYSTEM_PASSWORD);
  }

Is there some way to .setRelayHosts() or do I need to look for another framework or, heaven forbid, try to finagle this stuff into working with multiple hosts.


Solution

  • It's not possible right now. Spring websocket is sort of half-baked.