-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#11186] Change gRPC UNARY response based on header value
- Loading branch information
1 parent
887ec53
commit 0338829
Showing
7 changed files
with
76 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
grpc/src/main/java/com/navercorp/pinpoint/grpc/client/retry/RetryHeaderFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.navercorp.pinpoint.grpc.client.retry; | ||
|
||
import com.navercorp.pinpoint.grpc.Header; | ||
import com.navercorp.pinpoint.grpc.client.HeaderFactory; | ||
import io.grpc.Metadata; | ||
|
||
import java.util.Objects; | ||
|
||
public class RetryHeaderFactory implements HeaderFactory { | ||
|
||
private final HeaderFactory headerFactory; | ||
|
||
public RetryHeaderFactory(HeaderFactory headerFactory) { | ||
this.headerFactory = Objects.requireNonNull(headerFactory, "headerFactory"); | ||
} | ||
Check warning on line 15 in grpc/src/main/java/com/navercorp/pinpoint/grpc/client/retry/RetryHeaderFactory.java
|
||
|
||
@Override | ||
public Metadata newHeader() { | ||
Metadata metadata = headerFactory.newHeader(); | ||
metadata.put(Header.RETRY_FRIENDLY_RESPONSE, Boolean.TRUE.toString()); | ||
return metadata; | ||
Check warning on line 21 in grpc/src/main/java/com/navercorp/pinpoint/grpc/client/retry/RetryHeaderFactory.java
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters