akka-rabbitmq
akka-rabbitmq copied to clipboard
Specifying node's address for Rabbitmq cluster
In cluster environment usually it is possible to specify node's address in factory.newConnection(List<Address> addrs) method. Is it possible to do the same in Newmotion.
You can do this:
val factory = new ConnectionFactory {
setHost(connectionParams.hosts.head.getHost)
setPort(connectionParams.hosts.head.getPort)
setUsername(connectionParams.username)
setPassword(connectionParams.password)
setVirtualHost(connectionParams.virtualHost)
}
val connectionActor = system.actorOf(ConnectionActor.props(factory), "connection-actor")
Reading your question again, I see your question is about multiple hosts. Indeed there is currently no clean way to set these. A workaround would be to extend the ConnectionFactory class and to override the newConnection() method.