diff options
author | Ivan Topolnak <itopolnak@despegar.com> | 2014-01-13 17:56:51 -0300 |
---|---|---|
committer | Ivan Topolnak <itopolnak@despegar.com> | 2014-01-13 17:56:51 -0300 |
commit | 111ea55690351d0903e9902c525c781ef2d743a8 (patch) | |
tree | 003b0e1cf95f1d3cba55927422ff063c049a5cf9 /kamon-playground/src/main/scala/test | |
parent | 571e96665bb3cb3f20fb59209be63dabbb3148f4 (diff) | |
parent | 7a10c0ef2a6566229e8571f6d385ca2ff794cc20 (diff) | |
download | Kamon-111ea55690351d0903e9902c525c781ef2d743a8.tar.gz Kamon-111ea55690351d0903e9902c525c781ef2d743a8.tar.bz2 Kamon-111ea55690351d0903e9902c525c781ef2d743a8.zip |
Merge branch 'wip/trace-and-metrics-integration'
Conflicts:
kamon-newrelic/src/main/scala/kamon/newrelic/NewRelicErrorLogger.scala
Diffstat (limited to 'kamon-playground/src/main/scala/test')
-rw-r--r-- | kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala b/kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala index 333f5031..868a1921 100644 --- a/kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala +++ b/kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala @@ -24,6 +24,7 @@ import kamon.spray.UowDirectives import kamon.trace.Trace import kamon.Kamon import scala.util.Random +import akka.routing.RoundRobinRouter object SimpleRequestProcessor extends App with SimpleRoutingApp with RequestBuilding with UowDirectives { import scala.concurrent.duration._ @@ -34,7 +35,6 @@ object SimpleRequestProcessor extends App with SimpleRoutingApp with RequestBuil import system.dispatcher val act = system.actorOf(Props(new Actor { - println("Initializing from: " + (new Throwable).getStackTraceString) def receive: Actor.Receive = { case any ⇒ sender ! any } }), "com") @@ -43,7 +43,7 @@ object SimpleRequestProcessor extends App with SimpleRoutingApp with RequestBuil implicit val timeout = Timeout(30 seconds) val pipeline = sendReceive - val replier = system.actorOf(Props[Replier]) + val replier = system.actorOf(Props[Replier].withRouter(RoundRobinRouter(nrOfInstances = 2)), "replier") val random = new Random() startServer(interface = "localhost", port = 9090) { get { @@ -83,6 +83,12 @@ object SimpleRequestProcessor extends App with SimpleRoutingApp with RequestBuil complete(Future { "OK" }) } } ~ + path("kill") { + dynamic { + replier ! PoisonPill + complete(Future { "OK" }) + } + } ~ path("error") { complete { throw new NullPointerException @@ -121,7 +127,7 @@ class Replier extends Actor with ActorLogging { if (Trace.context.isEmpty) log.warning("PROCESSING A MESSAGE WITHOUT CONTEXT") - log.info("Processing at the Replier") + log.info("Processing at the Replier, and self is: {}", self) sender ! anything } } |