Giter Site home page Giter Site logo

Comments (2)

splittingred avatar splittingred commented on August 27, 2024

Hey @ingnam - Thanks! gruf mainly uses the core grpc interceptors (it just has a base class for some convenience methods), so if there's an issue, it's likely there. A few questions to clarify:

  1. What version of the gRPC gem are you using?
  2. grpc essentially does this on the execute method (called lower-level by the call method on the client):
# c -> ActiveCall obj
# req -> request message
intercept_args = {
  method: method,
  request: req,
  call: c.interceptable,
  metadata: metadata
}
# ...
interception_context.intercept!(:server_streamer, intercept_args) do
  c.server_streamer(req, &blk)
end

And c.server_streamer in the base Gruf class just calls call:

      def server_streamer(request: nil, call: nil, method: nil, metadata: nil, &block)
        rc = Gruf::Outbound::RequestContext.new(
          type: :server_streamer,
          requests: [request],
          call: call,
          method: method,
          metadata: metadata
        )
        call(request_context: rc, &block)
      end

What happens if you use request_context.metadata[:tenant] = 'tenant_name' instead of a string key?

Other than that, my guess is that some reference in the c.merge_metadata_to_send(metadata) in the ClientStub grpc class is not maintained, which means modifications to the RequestContext metadata are not transitively persisted.

It may be a bit before I can get to this (shoulder injury), but that's the path of investigation I'd take.

from gruf.

splittingred avatar splittingred commented on August 27, 2024

Closing this - feel free to re-open if you can answer the above question and provide more details on your grpc version. Thanks!

from gruf.

Related Issues (20)

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.