Created
August 21, 2012 19:24
-
-
Save sstone/3418512 to your computer and use it in GitHub Desktop.
proxy client
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val system = ActorSystem("MySystem") | |
val connFactory = new ConnectionFactory() | |
connFactory.setHost("rabbitmq") | |
val conn = system.actorOf( | |
Props(new ConnectionOwner(connFactory)), | |
name = "conn") | |
val client = ConnectionOwner.createActor( | |
conn, | |
Props(new RpcClient()), | |
5 second) | |
waitForConnection(system, client).await() | |
val proxy = system.actorOf( | |
Props( | |
new AmqpProxy.ProxyClient( | |
client, | |
"amq.direct", | |
"calculator", | |
JsonSerializer | |
) | |
), | |
name = "proxy" | |
) | |
compute(proxy) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment