## Vert.x gRPC Context Storage

Vert.x gRPC Context Storage overrides the default `io.grpc.Context.Storage` implementation.

The default implementation always stores the gRPC context in a thread-local variable. This implementation stores the gRPC context the same way as Vert.x core stores request tracing data.

This means, for example, that when you implement a service method, the gRPC context is propagated across Vert.x async API calls:

    Context grpcCtx1 = Context.current();

    vertx.executeBlocking(() -> {

      // Same as grpcCtx1
      Context grpcCtx2 = Context.current();

      return doSomething();

    }).onComplete(ar -> {

      // Same as grpcCtx1 and grpcCtx2
      Context grpcCtx3 = Context.current();

    });

| The gRPC context is propagated across Vert.x async API calls only when the current Vert.x `Context` is bound to a Vert.x HTTP server request. It is not propagated if, for example, you invoke a stub on a non-Vert.x thread or from a verticle `start` method.

### Using Vert.x gRPC Context Storage

To use Vert.x gRPC Context Storage, add the following dependency to the dependencies section of your build descriptor:

- Maven (in your `pom.xml`):

    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-grpc-context-storage</artifactId>
      <version>5.0.5</version>
    </dependency>

- Gradle (in your `build.gradle` file):

    dependencies {
      compile 'io.vertx:vertx-grpc-context-storage:5.0.5'
    }