Skip to content

Commit

Permalink
implement document partial streaming
Browse files Browse the repository at this point in the history
  • Loading branch information
aktaskaan committed May 15, 2024
1 parent 252542c commit b3c16ae
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public class ApplicationParams {
@Value("${moving.case.types}")
private List<String> movingCaseTypes;

@Value("${filtered.request.headers}")
private List<String> filteredRequestHeaders;
@Value("#{'${request.forwarded_headers.from_client}'.split(',')}")
private List<String> clientRequestHeadersToForward;

public List<String> getMovingCaseTypes() {
return Optional.ofNullable(movingCaseTypes).orElse(emptyList());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private HttpGet prepareHttpRequest(UUID documentId, final Map<String, String> re
}

private void setRequestHeaders(final HttpGet httpGet, Map<String, String> requestHeaders) {
Set<String> filteredHeaders = new HashSet<>(applicationParams.getFilteredRequestHeaders());
Set<String> filteredHeaders = new HashSet<>(applicationParams.getClientRequestHeadersToForward());

// map client request headers
if (!filteredHeaders.isEmpty()) {
Expand All @@ -164,7 +164,7 @@ private void handleStreamResponse(HttpStatus statusCode,
HttpServletResponse httpResponseOut,
UUID documentId) {
switch (statusCode) {
case OK -> {
case OK, PARTIAL_CONTENT -> {
httpResponseOut.setStatus(statusCode.value());
mapResponseHeaders(httpClientResponse, httpResponseOut);
try {
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,6 @@ retry:
maxAttempts: ${RETRY_MAX_ATTEMPTS:3}
maxDelay: ${RETRY_MAX_DELAY:1000}

filtered:
request:
headers: ${FILTERED_REQUEST_HEADERS:RANGE}
request:
forwarded_headers:
from_client: ${CLIENT_REQUEST_HEADERS_TO_FORWARD:RANGE}

0 comments on commit b3c16ae

Please sign in to comment.