Skip to content

Commit

Permalink
fix:support higher version grpc. (#447)
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyeBeFreeman committed Nov 27, 2023
1 parent d482a1a commit c5aa159
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public static String nextReportServiceContractReqId() {
public static <T extends AbstractStub<T>> void attachRequestHeader(T stub, String nextID) {
Metadata extraHeaders = new Metadata();
extraHeaders.put(KEY_REQUEST_ID, nextID);
MetadataUtils.attachHeaders(stub, extraHeaders);
stub.withInterceptors(MetadataUtils.newAttachHeadersInterceptor(extraHeaders));
}

/**
Expand All @@ -170,7 +170,7 @@ public static <T extends AbstractStub<T>> void attachRequestHeader(T stub, Map<S
for (Entry<String, String> header : customHeader.entrySet()) {
customMetadata.put(Metadata.Key.of(header.getKey(), Metadata.ASCII_STRING_MARSHALLER), header.getValue());
}
MetadataUtils.attachHeaders(stub, customMetadata);
stub.withInterceptors(MetadataUtils.newAttachHeadersInterceptor(customMetadata));
}

public static void checkResponse(ResponseProto.Response response) throws PolarisException {
Expand Down

0 comments on commit c5aa159

Please sign in to comment.