diff --git a/stub/src/main/java/io/grpc/stub/MetadataUtils.java b/stub/src/main/java/io/grpc/stub/MetadataUtils.java index 0fedf3711f7..94dfb8e56ee 100644 --- a/stub/src/main/java/io/grpc/stub/MetadataUtils.java +++ b/stub/src/main/java/io/grpc/stub/MetadataUtils.java @@ -43,8 +43,10 @@ private MetadataUtils() {} * @param stub to bind the headers to. * @param extraHeaders the headers to be passed by each call on the returned stub. * @return an implementation of the stub with {@code extraHeaders} bound to each call. + * @deprecated Use {@code stub.withInterceptors(newAttachHeadersInterceptor(...))} instead. */ @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1789") + @Deprecated public static > T attachHeaders(T stub, Metadata extraHeaders) { return stub.withInterceptors(newAttachHeadersInterceptor(extraHeaders)); } @@ -98,8 +100,10 @@ public void start(Listener responseListener, Metadata headers) { * @param trailersCapture to record the last received trailers * @return an implementation of the stub that allows to access the last received call's * headers and trailers via {@code headersCapture} and {@code trailersCapture}. + * @deprecated Use {@code stub.withInterceptors(newCaptureMetadataInterceptor())} instead. */ @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1789") + @Deprecated public static > T captureMetadata( T stub, AtomicReference headersCapture,