Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create helidon context in gRPC server implementation #769

Merged
merged 3 commits into from
Jun 11, 2019
Merged

Create helidon context in gRPC server implementation #769

merged 3 commits into from
Jun 11, 2019

Conversation

thegridman
Copy link
Collaborator

This pull request is for issue #698.

This change adds a ability to set a Helidon io.helidon.common.context.Context when creating the gRPC server by calling the context(Context context) method on the GrpcServerConfiguration.Builder when creating the server configuration that will be used to configure the gRPC server.

The Thread factory used by the gRPC server thread pool creates threads that have the context set so that the context can be obtained using the static io.helidon.common.context.Contexts.context() method in call handling code. The context can also be obtained from the gRPC call context inside a gRPC service method using the io.helidon.grpc.core.ContextKeys.HELIDON_CONTEXT.get() method.

If tracing is enabled, the Tracer and the current SpanContext are set into the Context at the start of a gRPC server call so that they are available during handling of the call.

If security is enabled then the SecurityContext is also set into the Context.

Copy link
Member

@tomas-langer tomas-langer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thegridman
Copy link
Collaborator Author

I don't have permissions to merge; someone else will need to do it.

@romain-grecourt romain-grecourt merged commit 94fa18b into helidon-io:master Jun 11, 2019
@thegridman thegridman deleted the 698-context branch June 17, 2019 06:23
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