Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specifying node's address for Rabbitmq cluster #47

Open
navidhsz opened this issue Aug 31, 2018 · 2 comments
Open

Specifying node's address for Rabbitmq cluster #47

navidhsz opened this issue Aug 31, 2018 · 2 comments

Comments

@navidhsz
Copy link

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.

@sbmpost
Copy link
Contributor

sbmpost commented Dec 1, 2018

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")

@sbmpost
Copy link
Contributor

sbmpost commented Dec 1, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants