Skip to content

Instantly share code, notes, and snippets.

@Danthar
Created March 24, 2015 14:13
Show Gist options
  • Save Danthar/5f7e27956707de633431 to your computer and use it in GitHub Desktop.
Save Danthar/5f7e27956707de633431 to your computer and use it in GitHub Desktop.
Consume RabbitMq messages with Akka
system = ActorSystem.Create("myAkkaSystem");
var coordinator = system.ActorOf<WorkCoordinatorActor>("workcoordinator");
bus = RabbitHutch.CreateBus("host=localhost");
bus.Subscribe<CdrRecieved>("<mysubId>", message => {
var result = coordinator.Ask<WorkCompleted>(new StartWorkFor() {Details = message}).Result;
//do something with it
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment