Skip to content

Conversation

@rmichela
Copy link
Collaborator

No description provided.

@codecov
Copy link

codecov bot commented Oct 16, 2017

Codecov Report

Merging #54 into master will increase coverage by 4.98%.
The diff coverage is 83.89%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #54      +/-   ##
============================================
+ Coverage     53.26%   58.25%   +4.98%     
- Complexity      138      188      +50     
============================================
  Files            34       40       +6     
  Lines           766      915     +149     
  Branches         43       67      +24     
============================================
+ Hits            408      533     +125     
- Misses          341      359      +18     
- Partials         17       23       +6
Impacted Files Coverage Δ Complexity Δ
...alesforce/grpc/contrib/context/AmbientContext.java 77.5% <77.5%> (ø) 22 <22> (?)
...context/AmbientContextFreezeServerInterceptor.java 80% <80%> (ø) 2 <2> (?)
...ntrib/context/AmbientContextServerInterceptor.java 86.66% <86.66%> (ø) 9 <9> (?)
...ntext/AmbientContextEnforcerClientInterceptor.java 87.5% <87.5%> (ø) 7 <7> (?)
...ntext/AmbientContextEnforcerServerInterceptor.java 87.5% <87.5%> (ø) 7 <7> (?)
...ntrib/context/AmbientContextClientInterceptor.java 88.88% <88.88%> (ø) 3 <3> (?)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0ebb44f...c41f503. Read the comment docs.

@cbornet
Copy link
Contributor

cbornet commented Oct 16, 2017

I understand that the AmbientContext is a helper to get Metadata values from endpoint methods, is that correct ?
Do you know if there's a way to add metadata values to responses ?

@rmichela
Copy link
Collaborator Author

Request trailers can contain additional Metadata, although trailer metadata isn't readily accessible from stub API. Individual response messages cannot have their own metadata.

@rmichela rmichela merged commit e1b4abd into master Oct 19, 2017
@cbornet
Copy link
Contributor

cbornet commented Oct 19, 2017

The question is: can I get metadata in a Rxgrpc stub API from the Ambient context ?

@rmichela
Copy link
Collaborator Author

I haven't tried that yet, but it should work in theory. You would have to add the ambient context interceptors when using ManagedChannelBuilder and ServerBuilder. Since ambient context leverages the standard grpc Context, and RxGrpc correctly handles the Context, it should "just work".

@cbornet
Copy link
Contributor

cbornet commented Oct 20, 2017

Great ! This can be very helpful !

@rmichela rmichela deleted the feature/context branch November 20, 2017 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants