Comments (2)
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:
- What version of the gRPC gem are you using?
- grpc essentially does this on the
execute
method (called lower-level by thecall
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.
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)
- Please release 2.13.2 HOT 4
- Next step in `Server:-Creating-Controllers.md` not linked HOT 1
- Starting Gruf and bind with specific controllers HOT 4
- After Zeitwerk upgrade, specs don't autoload controller names HOT 7
- Request context for interceptors to communicate information back to controllers HOT 2
- 2.16 appears to autoload the HealthCheck even if not enabled HOT 1
- Minor typo in wiki, recommended fix :) HOT 1
- Gruf.controllers_path unloaded even in client mode HOT 2
- Question: is hot code reloading for other paths possible? HOT 1
- healthcheck cannot be seperated of main thread limit HOT 1
- Autoloading in development is not thread-safe HOT 3
- enabling TLS default
- Allow gruf to receive request objects in `call` HOT 2
- Ruby does not generate correct proto with ruby version 3.1.0 and 3.2.0 HOT 2
- Wiki: update instrumentation docs to rename blacklist to blocklist, since that's what it is in the code. HOT 1
- Ruby 3.3.0 support HOT 1
- Gruf server stuck at starting HOT 1
- Rails 7.1: DEPRECATION WARNING: Calling `ActiveRecord::Base.clear_active_connections! is deprecated. Please call the method directly on the connection handler; for example: `ActiveRecord::Base.connection_handler.clear_active_connections! HOT 1
- Did release 2.17.0 break call concurrency? HOT 9
- Use `ActiveSupport::Notifications::Instrument` instead of `event_listener_proc`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gruf.