Skip to content

Commit c4e14d3

Browse files
added new header for routing to desired database
1 parent 8e58f1b commit c4e14d3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

grpc-context-utils/src/main/java/org/hypertrace/core/grpcutils/context/RequestContextConstants.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
public class RequestContextConstants {
1313
public static final String TENANT_ID_HEADER_KEY = "x-tenant-id";
1414
public static final String REQUEST_ID_HEADER_KEY = "request-id";
15+
public static final String DATABASE_ID_HEADER_KEY = "x-database-id";
1516

1617
public static final Metadata.Key<String> TENANT_ID_METADATA_KEY =
1718
Metadata.Key.of(TENANT_ID_HEADER_KEY, ASCII_STRING_MARSHALLER);
@@ -27,12 +28,13 @@ public class RequestContextConstants {
2728
"traceparent",
2829
"tracestate",
2930
AUTHORIZATION_HEADER,
30-
REQUEST_ID_HEADER_KEY);
31+
REQUEST_ID_HEADER_KEY,
32+
DATABASE_ID_HEADER_KEY);
3133

3234
/**
3335
* These headers may affect returned results and should be accounted for in any cached remote
3436
* results
3537
*/
3638
static final Set<String> CACHE_MEANINGFUL_HEADERS =
37-
Set.of(TENANT_ID_HEADER_KEY, AUTHORIZATION_HEADER);
39+
Set.of(TENANT_ID_HEADER_KEY, AUTHORIZATION_HEADER, DATABASE_ID_HEADER_KEY);
3840
}

0 commit comments

Comments
 (0)