-
Notifications
You must be signed in to change notification settings - Fork 0
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
[ESWE-1181] Fix API clients, JPA auditing #25
Conversation
1) MN API client: missing body 2) JB API client: scopes' separator 3) Error logging 4) Rename container name of local hmpps-auth (avoid conflict at Docker)
enable JPA auditing for `@CreatedDate` and `@LastModifiedDate`
container_name: hmpps-auth | ||
container_name: integration-hmpps-auth |
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.
rename container for avoiding name clash to hmpps-auth
instance (standalone at 9090)
import org.springframework.data.jpa.repository.config.EnableJpaAuditing | ||
|
||
@Configuration | ||
@EnableJpaAuditing |
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.
enable JPA auditing for audit fields (create and last updated timestamps)
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.
add client logging for troubleshooting, disabled by default.
enable this by setting api.client.logging.enabled
to true
, when needed
.onErrorResume(WebClientResponseException.NotFound::class.java) { error -> | ||
val errorResponse = if (error is WebClientResponseException) error.responseBodyAsString else null | ||
log.warn("Employer not found. employerId={}; errorResponse={}", id, errorResponse) |
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.
error logging - write down the error response, if any
.onErrorResume { error -> | ||
val errorResponse = if (error is WebClientResponseException) error.responseBodyAsString else null | ||
Mono.error(Exception("Fail to create employer! errorResponse=$errorResponse", error)) |
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.
error logging - write down the error response, if any
|
||
logging.level: | ||
uk.gov.justice.digital.hmpps.jobsboardintegrationapi: | ||
shared.infrastructure: DEBUG |
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.
set this to TRACE
for troubleshooting
logging.level: | ||
uk.gov.justice.digital.hmpps.jobsboardintegrationapi: | ||
shared.infrastructure: DEBUG | ||
reactor.netty.http.client: INFO |
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.
set this to DEBUG
for troubleshooting
Fix API clients
hmpps-auth
(avoid conflict at Docker)Fix JPA auditing
@CreatedDate
and@LastModifiedDate