-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lagt til logging av CallId i kall mot pensjon #3438
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ | |
import java.util.List; | ||
import java.util.Set; | ||
|
||
import static no.nav.dolly.util.CallIdUtil.generateCallId; | ||
import static no.nav.dolly.util.JacksonExchangeStrategyUtil.getJacksonStrategy; | ||
|
||
@Slf4j | ||
|
@@ -59,100 +60,111 @@ public PensjonforvalterConsumer( | |
.build(); | ||
} | ||
|
||
@Timed(name = "providers", tags = {"operation", "pen_getMiljoer"}) | ||
@Timed(name = "providers", tags = { "operation", "pen_getMiljoer" }) | ||
public Mono<Set<String>> getMiljoer() { | ||
|
||
return tokenService.exchange(serverProperties) | ||
.flatMap(token -> new HentMiljoerCommand(webClient, token.getTokenValue()).call()); | ||
} | ||
|
||
@Timed(name = "providers", tags = {"operation", "popp_lagreInntekt"}) | ||
@Timed(name = "providers", tags = { "operation", "popp_lagreInntekt" }) | ||
public Flux<PensjonforvalterResponse> lagreInntekter(PensjonPoppInntektRequest pensjonPoppInntektRequest) { | ||
|
||
log.info("Popp lagre inntekt {}", pensjonPoppInntektRequest); | ||
String callId = generateCallId(); | ||
log.info("Popp lagre inntekt {}, callId: {}", pensjonPoppInntektRequest, callId); | ||
return tokenService.exchange(serverProperties) | ||
.flatMapMany(token -> new LagrePoppInntektCommand(webClient, token.getTokenValue(), | ||
pensjonPoppInntektRequest).call()); | ||
pensjonPoppInntektRequest, callId).call()); | ||
} | ||
|
||
@Timed(name = "providers", tags = {"operation", "pen_opprettPerson"}) | ||
@Timed(name = "providers", tags = { "operation", "pen_opprettPerson" }) | ||
public Flux<PensjonforvalterResponse> opprettPerson(PensjonPersonRequest pensjonPersonRequest, | ||
Set<String> miljoer) { | ||
|
||
pensjonPersonRequest.setMiljoer(miljoer); | ||
log.info("Pensjon opprett person {}", pensjonPersonRequest); | ||
String callId = generateCallId(); | ||
log.info("Pensjon opprett person {}, callId: {}", pensjonPersonRequest, callId); | ||
return tokenService.exchange(serverProperties) | ||
.flatMapMany(token -> new OpprettPersonCommand(webClient, pensjonPersonRequest, token.getTokenValue()).call()); | ||
.flatMapMany(token -> new OpprettPersonCommand(webClient, pensjonPersonRequest, token.getTokenValue(), callId).call()); | ||
} | ||
|
||
@Timed(name = "providers", tags = {"operation", "pen_hentSamboer"}) | ||
@Timed(name = "providers", tags = { "operation", "pen_hentSamboer" }) | ||
public Flux<PensjonSamboerResponse> hentSamboer(String ident, String miljoe) { | ||
|
||
return tokenService.exchange(serverProperties) | ||
.flatMapMany(token -> new HentSamboerCommand(webClient, ident, miljoe, token.getTokenValue()).call()) | ||
.doOnNext(response -> log.info("Pensjon samboer for {} i {} hentet {}", ident, miljoe, response)); | ||
} | ||
|
||
@Timed(name = "providers", tags = {"operation", "pen_opprettSamboer"}) | ||
@Timed(name = "providers", tags = { "operation", "pen_opprettSamboer" }) | ||
public Flux<PensjonforvalterResponse> lagreSamboer(PensjonSamboerRequest pensjonSamboerRequest, | ||
String miljoe) { | ||
|
||
log.info("Pensjon samboer opprett i {} {}", miljoe, pensjonSamboerRequest); | ||
String callId = generateCallId(); | ||
log.info("Pensjon samboer opprett i {} {}, callId: {}", miljoe, pensjonSamboerRequest, callId); | ||
return tokenService.exchange(serverProperties) | ||
.flatMapMany(token -> new LagreSamboerCommand(webClient, pensjonSamboerRequest, miljoe, token.getTokenValue()).call()); | ||
.flatMapMany(token -> new LagreSamboerCommand(webClient, pensjonSamboerRequest, miljoe, token.getTokenValue(), callId).call()); | ||
} | ||
|
||
@Timed(name = "providers", tags = {"operation", "pen_opprettSamboer"}) | ||
@Timed(name = "providers", tags = { "operation", "pen_opprettSamboer" }) | ||
public Flux<PensjonforvalterResponse> annullerSamboer(String ident, String periodeId, String miljoe) { | ||
|
||
log.info("Pensjon samboer annuller {} periodeId {}", ident, periodeId); | ||
String callId = generateCallId(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bruk generelt |
||
log.info("Pensjon samboer annuller {} periodeId {}, callId: {}", ident, periodeId, callId); | ||
return tokenService.exchange(serverProperties) | ||
.flatMapMany(token -> new AnnullerSamboerCommand(webClient, periodeId, miljoe, token.getTokenValue()).call()); | ||
.flatMapMany(token -> new AnnullerSamboerCommand(webClient, periodeId, miljoe, token.getTokenValue(), callId).call()); | ||
} | ||
|
||
@Timed(name = "providers", tags = {"operation", "pen_lagreAlderspensjon"}) | ||
@Timed(name = "providers", tags = { "operation", "pen_lagreAlderspensjon" }) | ||
public Flux<PensjonforvalterResponse> lagreAlderspensjon(AlderspensjonRequest request) { | ||
|
||
log.info("Pensjon lagre alderspensjon {}", request); | ||
String callId = generateCallId(); | ||
log.info("Pensjon lagre alderspensjon {}, callId: {}", request, callId); | ||
return tokenService.exchange(serverProperties) | ||
.flatMapMany(token -> | ||
new LagreAlderspensjonCommand(webClient, token.getTokenValue(), request).call()); | ||
new LagreAlderspensjonCommand(webClient, token.getTokenValue(), request, callId).call()); | ||
} | ||
|
||
@Timed(name = "providers", tags = {"operation", "pen_lagreUforetrygd"}) | ||
@Timed(name = "providers", tags = { "operation", "pen_lagreUforetrygd" }) | ||
public Flux<PensjonforvalterResponse> lagreUforetrygd(PensjonUforetrygdRequest request) { | ||
|
||
log.info("Pensjon lagre uforetrygd {}", request); | ||
String callId = generateCallId(); | ||
log.info("Pensjon lagre uforetrygd {}, callId: {}", request, callId); | ||
return tokenService.exchange(serverProperties) | ||
.flatMapMany(token -> new LagreUforetrygdCommand(webClient, token.getTokenValue(), request).call()); | ||
.flatMapMany(token -> new LagreUforetrygdCommand(webClient, token.getTokenValue(), request, callId).call()); | ||
} | ||
|
||
@Timed(name = "providers", tags = {"operation", "pen_lagreTpForhold"}) | ||
@Timed(name = "providers", tags = { "operation", "pen_lagreTpForhold" }) | ||
public Flux<PensjonforvalterResponse> lagreTpForhold(PensjonTpForholdRequest pensjonTpForholdRequest) { | ||
|
||
log.info("Pensjon lagre TP-forhold {}", pensjonTpForholdRequest); | ||
String callId = generateCallId(); | ||
log.info("Pensjon lagre TP-forhold {}, callId: {}", pensjonTpForholdRequest, callId); | ||
return tokenService.exchange(serverProperties) | ||
.flatMapMany(token -> new LagreTpForholdCommand(webClient, token.getTokenValue(), pensjonTpForholdRequest).call()); | ||
.flatMapMany(token -> new LagreTpForholdCommand(webClient, token.getTokenValue(), pensjonTpForholdRequest, callId).call()); | ||
} | ||
|
||
@Timed(name = "providers", tags = {"operation", "pen_sletteTpForhold"}) | ||
@Timed(name = "providers", tags = { "operation", "pen_sletteTpForhold" }) | ||
public void sletteTpForhold(List<String> identer) { | ||
|
||
String callId = generateCallId(); | ||
log.info("Pensjon slette TP-forhold callId: {}", callId); | ||
|
||
tokenService.exchange(serverProperties) | ||
.flatMapMany(token -> new HentMiljoerCommand(webClient, token.getTokenValue()).call() | ||
.flatMapMany(miljoer -> Flux.range(0, identer.size()) | ||
.map(index -> new SletteTpForholdCommand(webClient, identer.get(index), miljoer, token.getTokenValue()).call()))) | ||
.map(index -> new SletteTpForholdCommand(webClient, identer.get(index), miljoer, token.getTokenValue(), callId).call()))) | ||
.flatMap((Flux::from)) | ||
.collectList() | ||
.subscribe(response -> log.info("Slettet mot PESYS (tp) i alle miljoer")); | ||
} | ||
|
||
@Timed(name = "providers", tags = {"operation", "pen_lagreTpYtelse"}) | ||
@Timed(name = "providers", tags = { "operation", "pen_lagreTpYtelse" }) | ||
public Flux<PensjonforvalterResponse> lagreTpYtelse(PensjonTpYtelseRequest pensjonTpYtelseRequest) { | ||
|
||
log.info("Pensjon lagre TP-ytelse {}", pensjonTpYtelseRequest); | ||
String callId = generateCallId(); | ||
log.info("Pensjon lagre TP-ytelse {}, callId: {}", pensjonTpYtelseRequest, callId); | ||
return tokenService.exchange(serverProperties) | ||
.flatMapMany(token -> new LagreTpYtelseCommand(webClient, token.getTokenValue(), pensjonTpYtelseRequest).call()); | ||
.flatMapMany(token -> new LagreTpYtelseCommand(webClient, token.getTokenValue(), pensjonTpYtelseRequest, callId).call()); | ||
} | ||
|
||
@Override | ||
|
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
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nå når callId også skal logges kunne det være et alternativ å flytte loggingen inn i command-fil, istedet for å introdusere et parameter til. Det vil være enklere å lese og vedlikeholde, men dette er også OK.
(så lite kode som mulig bør være målet 😄 )