Giter VIP home page Giter VIP logo

mdc-propagation-dispatcher's People

Contributors

rishabh9 avatar vincentdehaan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mdc-propagation-dispatcher's Issues

MDC context propagation is not working in play 2.6

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:

  1. MDC propagation between http filter and http controller
  2. MDC propagation between http controller and akka actor
  3. MDC propagation between actors
  4. MDC propagation between http controller and async thread

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

not work in my side

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

How to use classic MDC in Akka HTTP

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...

Scala 2.12 & Play 2.7

If this project is still maintained would it be possible to get a release for Scala 2.12 and Play 2.7?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.