Open navidhsz opened 6 years ago
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.
In cluster environment usually it is possible to specify node's address in factory.newConnection(List
addrs) method. Is it possible to do the same in Newmotion.