Interface GrpcClient.Stub<A extends ExchangeContext,B extends GrpcClient.Stub<A,B>>

Type Parameters:
A - the exchange context type
B - the stub type
All Superinterfaces:
AutoCloseable
Enclosing interface:
GrpcClient

public static interface GrpcClient.Stub<A extends ExchangeContext,B extends GrpcClient.Stub<A,B>> extends AutoCloseable

A base gRPC client stub definition.

This is intended to be used when generating gRPC client stub from Protocol buffer definitions.

Since:
1.9
Author:
Jeremy Kuhn
  • Method Details

    • withMetadata

      B withMetadata(Consumer<GrpcOutboundRequestMetadata> metadataConfigurer)

      Returns a new stub configured with the specified metadata.

      Parameters:
      metadataConfigurer - a gRPC request metadata configurer
      Returns:
      a configured stub
    • close

      default void close()

      Subscribes to shutdownGracefully() in order to eventually close the underlying endpoint.

      This method should return right away before the endpoint is actually closed, you should prefer shutdown() or shutdownGracefully() to control when the endpoint is actually closed.

      Specified by:
      close in interface AutoCloseable
    • shutdown

      Mono<Void> shutdown()

      Shutdowns the underlying endpoint right away.

      Returns:
      a mono which completes once the underlying endpoint is shutdown
    • shutdownGracefully

      Mono<Void> shutdownGracefully()

      Gracefully shutdwon the underlying endpoint.

      Returns:
      a mono which completes once the underlying endpoint is shutdown