rishabh9 / mdc-propagation-dispatcher Goto Github PK
View Code? Open in Web Editor NEWA Mapped Diagnostic Context (MDC) propagation Akka Dispatcher for the asynchronous environment of the Play Framework.
License: Other
A Mapped Diagnostic Context (MDC) propagation Akka Dispatcher for the asynchronous environment of the Play Framework.
License: Other
Hello,
This thread context propagation approach is not working if adding it as separate jar to classpath of client project (as described in caveats here).
This config is added from client project side (note that play section is removed as discussed there).
akka {
actor {
default-dispatcher = {
type = "mdc.MDCPropagatingDispatcherConfigurator"
}
}
}
Tested this cases:
All the above cases with give configuration are not working. In fact, in case of adding custom dispatcher configuration to target project itself, only propagation between http filter and http controller is floatingly working (for some reason works only in debug mode).
Could you please point me out if I'm missing something?
Thanks in advance
below is log,
10:53:10.192 [info] akka.event.slf4j.Slf4jLogger - - Slf4jLogger started
10:53:10.204 [info] controllers.HomeController 27ece190-b287-4a87-8f15-9a48d6de10d8 - enter timecost
10:53:10.204 [info] controllers.HomeController 27ece190-b287-4a87-8f15-9a48d6de10d8 - enter callFUN start
10:53:10.205 [info] controllers.HomeController - - work callfun
10:53:15.209 [info] controllers.HomeController - - work callfun end
10:53:15.209 [info] controllers.HomeController - - call callFunc:OK
the UUID is not present in another thread
Hi.
Can this dispatcher be used in Akka HTTP. I'm sending a message from web server to Actor using ask pattern.
In web server, I'm including default ExecutionContext
implicit val ec = actorSystem.dispatchers.lookup("swipestox.activity-feed.dispatchers.mdc")
Then, I'm doing the same thing in Actor:
implicit val ec = actorSystem.dispatchers.lookup("swipestox.activity-feed.dispatchers.mdc")
Here is a definition of dispatcher:
mdc {
type = "com.github.rishabh9.MDCPropagatingDispatcherConfigurator"
executor = "fork-join-executor"
fork-join-executor {
parallelism-min = 2
parallelism-factor = 2
parallelism-max = 10
}
throughput = 100
}
So, when I pass some variable to MDC before calling Actor:
MDC.put("req_id", requestId)
Writing that value in actor gives null:
logger.info(s"req id: ${MDC.get("req_id")}")
Can it work with Akka HTTP and Akka Actors in general, not just Play? Looking at the code, it can, but I can't manage do find a way...
If this project is still maintained would it be possible to get a release for Scala 2.12 and Play 2.7?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.