-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/pdl person oppslag til person service (#3299)
PDL-person hentes fra person-service
- Loading branch information
Showing
94 changed files
with
501 additions
and
1,333 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
45 changes: 45 additions & 0 deletions
45
...nd/src/main/java/no/nav/dolly/bestilling/personservice/command/PdlPersonerGetCommand.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,45 @@ | ||
package no.nav.dolly.bestilling.personservice.command; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import no.nav.dolly.domain.PdlPersonBolk; | ||
import no.nav.dolly.util.WebClientFilter; | ||
import org.springframework.web.reactive.function.client.WebClient; | ||
import org.springframework.web.reactive.function.client.WebClientResponseException; | ||
import reactor.core.publisher.Flux; | ||
import reactor.core.publisher.Mono; | ||
import reactor.util.retry.Retry; | ||
|
||
import java.time.Duration; | ||
import java.util.List; | ||
import java.util.concurrent.Callable; | ||
|
||
import static org.springframework.http.HttpHeaders.AUTHORIZATION; | ||
|
||
@RequiredArgsConstructor | ||
public class PdlPersonerGetCommand implements Callable<Flux<PdlPersonBolk>> { | ||
|
||
private static final String PERSON_SERVICE_URL = "/api/v2/personer/identer"; | ||
|
||
private final WebClient webClient; | ||
private final List<String> identer; | ||
private final String token; | ||
|
||
@Override | ||
public Flux<PdlPersonBolk> call() { | ||
|
||
return webClient | ||
.get() | ||
.uri(uriBuilder -> uriBuilder | ||
.path(PERSON_SERVICE_URL) | ||
.queryParam("identer", identer) | ||
.build()) | ||
.header(AUTHORIZATION, "Bearer " + token) | ||
.retrieve() | ||
.bodyToFlux(PdlPersonBolk.class) | ||
.doOnError(WebClientFilter::logErrorMessage) | ||
.retryWhen(Retry.backoff(3, Duration.ofSeconds(5)) | ||
.filter(WebClientFilter::is5xxException)) | ||
.onErrorResume(throwable -> throwable instanceof WebClientResponseException.NotFound, | ||
throwable -> Mono.empty()); | ||
} | ||
} |
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
Oops, something went wrong.